TabContainerViewImpl extends Composite implements TabContainerView { @Override public void selectTab(@NotNull Tab tab) { for (TabWidget widget : titles.values()) { widget.unSelect(); } boolean isLeftPanel = LEFT.equals(tab.getTabType()); titles.get(tab.getTitle()).select(isLeftPanel ? Background.BLACK : Background.GREY); } @Inject  TabContainerViewImpl(RunnerResources resources, WidgetFactory widgetFactory); @Override void showTab(@NotNull Tab tab); @Override void selectTab(@NotNull Tab tab); @Override void setVisibleTitle(@NotNull Map<String, Boolean> tabVisibilities); @Override void addTab(@NotNull Tab tab); @Override void showTabTitle(@NotNull String tabName, boolean isShown); @Override void setDelegate(ActionDelegate actionDelegate);  }
@Test public void shouldSelectTabWhenTabHasTypeLeftPanel() { addThreeTabs(); tabContainerView.selectTab(tab1); verify(tabWidget1).unSelect(); verify(tabWidget2).unSelect(); verify(tabWidget3).unSelect(); verify(tabWidget1).select(Background.BLACK); }
@Test public void shouldSelectTabWhenTabHasTypeRightPanel() { addThreeTabs(); tabContainerView.selectTab(tab3); verify(tabWidget1).unSelect(); verify(tabWidget2).unSelect(); verify(tabWidget3).unSelect(); verify(tabWidget3).select(Background.GREY); }