ToolAdminPresenterImpl implements ToolAdminView.Presenter,
                                               AddToolSelectedEvent.AddToolSelectedEventHandler,
                                               ToolSelectedEvent.ToolSelectedEventHandler,
                                               SaveToolSelectedEvent.SaveToolSelectedEventHandler,
                                               DeleteToolSelectedEvent.DeleteToolSelectedEventHandler { @Override public void onAddToolSelected(AddToolSelectedEvent event) { ToolList toolList = factory.getToolList().as(); List<Tool> listTool = new ArrayList<>(); listTool.add(event.getTool()); toolList.setToolList(listTool); toolAdminServiceFacade.addTool(toolList, new AsyncCallback<Void>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(Void result) { announcer.schedule(new SuccessAnnouncementConfig(appearance.addToolSuccessText())); updateView(); } }); } @Inject  ToolAdminPresenterImpl(final ToolAdminViewFactory viewFactory,
                                  ToolAdminServiceFacade toolAdminServiceFacade,
                                  ToolAutoBeanFactory factory,
                                  ToolProperties toolProperties,
                                  ToolAdminView.ToolAdminViewAppearance appearance); @Override void go(HasOneWidget container); @Override void setViewDebugId(String baseId); @Override void onAddToolSelected(AddToolSelectedEvent event); @Override void onDeleteToolSelected(final DeleteToolSelectedEvent event); @Override void onToolSelected(ToolSelectedEvent event); @Override void onSaveToolSelected(SaveToolSelectedEvent event);  }
@Test public void testOnAddToolSelected() { AddToolSelectedEvent addToolSelectedEventMock = mock(AddToolSelectedEvent.class); Tool toolMock = mock(Tool.class); when(addToolSelectedEventMock.getTool()).thenReturn(toolMock); ToolList toolListMock = mock(ToolList.class); when(toolAutoBeanFactoryMock.getToolList()).thenReturn(toolListAutoBeanMock); when(toolListAutoBeanMock.as()).thenReturn(toolListMock); uut.onAddToolSelected(addToolSelectedEventMock); verify(toolAdminServiceFacadeMock).addTool(eq(toolListMock), asyncCallbackVoidCaptor.capture()); }