TabContainerPresenter implements TabContainer, TabContainerView.ActionDelegate, PanelState.StateChangeListener { @Override public void onTabClicked(@NotNull String title) { Tab tab = tabs.get(title); if (tab != null && title.equals(tab.getTitle())) { tab.performHandler(); view.showTab(tab); view.selectTab(tab); } } @Inject  TabContainerPresenter(TabContainerView view, PanelState panelState, RunnerLocalizationConstant locale); @Override void go(AcceptsOneWidget container); @Override void showTab(@NotNull String title); @Override void addTab(@NotNull Tab tab); @Override void showTabTitle(@NotNull String tabName, boolean isShown); @Override void setLocation(@NotNull PanelLocation panelLocation); @Override void onTabClicked(@NotNull String title); @Override void onStateChanged();  }
@Test public void shouldOnTabClickedWhenTitleIsWrong() { addTwoTabs(); tabContainerPresenter.onTabClicked("some not exist title"); verify(tab1).getTitle(); verify(tab2).getTitle(); verifyNoMoreInteractions(view, tab1, tab2); }