AppCategoriesPresenterImpl implements AppCategoriesView.Presenter,
                                                   AppCategoriesView.AppCategoryHierarchyProvider,
                                                   AppUpdatedEvent.AppUpdatedEventHandler,
                                                   AppSavedEvent.AppSavedEventHandler,
                                                   AppCategorySelectionChangedEvent.AppCategorySelectionChangedEventHandler { @Override public void onCopyAppSelected(CopyAppSelected event) { Preconditions.checkArgument(event.getApps().size() == 1); final App appToBeCopied = event.getApps().iterator().next(); appUserService.copyApp(appToBeCopied, new AsyncCallback<AppTemplate>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(final AppTemplate app) { if (!app.getId().isEmpty()) { announcer.schedule(new SuccessAnnouncementConfig(appearance.copyAppSuccessMessage(appToBeCopied.getName()))); workspaceView.getTree().getSelectionModel().deselectAll(); AppCategory userCategory = findAppCategoryByName(USER_APPS_GROUP); workspaceView.getTree().getSelectionModel().select(userCategory, false); eventBus.fireEvent(new EditAppEvent(app, false)); } } }); } @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 testOnCopyAppSelected() { CopyAppSelected eventMock = mock(CopyAppSelected.class); final App mockApp = mock(App.class); when(mockApp.getId()).thenReturn("mockAppId"); when(eventMock.getApps()).thenReturn(Lists.newArrayList(mockApp)); uut.onCopyAppSelected(eventMock); verify(appUserServiceMock).copyApp(eq(mockApp), Matchers.<AsyncCallback<AppTemplate>>any()); }