AppCategoriesPresenterImpl implements AppCategoriesView.Presenter,
                                                   AppCategoriesView.AppCategoryHierarchyProvider,
                                                   AppUpdatedEvent.AppUpdatedEventHandler,
                                                   AppSavedEvent.AppSavedEventHandler,
                                                   AppCategorySelectionChangedEvent.AppCategorySelectionChangedEventHandler { @Override public void onCopyWorkflowSelected(final CopyWorkflowSelected event) { Preconditions.checkArgument(event.getApps().size() == 1); final App appToBeCopied = event.getApps().iterator().next(); appUserService.copyWorkflow(appToBeCopied.getId(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(String result) { workspaceView.getTree().getSelectionModel().deselectAll(); AppCategory userAppsGrp = findAppCategoryByName(USER_APPS_GROUP); workspaceView.getTree().getSelectionModel().select(userAppsGrp, false); Splittable serviceWorkflowJson = StringQuoter.split(result); eventBus.fireEvent(new EditWorkflowEvent(appToBeCopied, serviceWorkflowJson)); } }); } @Inject  AppCategoriesPresenterImpl(final DEProperties props,
                               final JsonUtil jsonUtil,
                               final EventBus eventBus,
                               final AppCategoriesViewFactory viewFactory); @Override List<String> getGroupHierarchy(AppCategory appCategory); @Override AppCategory getSelectedAppCategory(); @Override AppCategoriesView getWorkspaceView(); @Override void go(final HasId selectedAppCategory, final DETabPanel tabPanel); @Override void setViewDebugId(String baseID); @Override void onAppSaved(AppSavedEvent event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onAppUpdated(final AppUpdatedEvent event); @Override void onCopyAppSelected(CopyAppSelected event); @Override void onCopyWorkflowSelected(final CopyWorkflowSelected event); @Override HandlerRegistration addAppCategorySelectedEventHandler(AppCategorySelectionChangedEvent.AppCategorySelectionChangedEventHandler handler); @Override void onAppCategorySelectionChanged(AppCategorySelectionChangedEvent event);  }
@Test public void testOnCopyWorkflowSelected() { CopyWorkflowSelected eventMock = mock(CopyWorkflowSelected.class); final App mockApp = mock(App.class); when(mockApp.getId()).thenReturn("mockAppId"); when(eventMock.getApps()).thenReturn(Lists.newArrayList(mockApp)); uut.onCopyWorkflowSelected(eventMock); verify(appUserServiceMock).copyWorkflow(eq(mockApp.getId()), Matchers.<AsyncCallback<String>>any()); }