TabPanelWithDropdowns extends Composite { void registerTabHandlers(final TabPanelEntry tab) { final Multimap<TabPanelEntry, HandlerRegistration> registrations = getTabHandlerRegistrations(); final TabPanelEntry.DropDownTabListItem tabWidget = tab.getTabWidget(); registrations.put(tab, tabWidget.addShowHandler(getIndividualTabShowHandler())); registrations.put(tab, tabWidget.addShownHandler(getIndividualTabShownHandler())); }  HandlerRegistration addShowHandler(TabShowHandler tabShowHandler); HandlerRegistration addShownHandler(TabShownHandler tabShownHandler); @PostConstruct void init(); TabPanelEntry addItem(String label,
                                 Widget content); void addItem(final TabPanelEntry tab); void insertItem(final TabPanelEntry tab,
                           final int index); NavTabs getTabBar(); boolean remove(TabPanelEntry tab); DropDownTab addDropdownTab(String label); void addDropdownTab(DropDownTab contents); void clear(); TabPanelEntry getActiveTab(); int getSelectedTabIndex(); void selectTabIndex(int index); TabPanelEntry findEntryForTabWidget(final TabListItem tabWidget); void addTabBarWidget(final IsWidget customWidget);  }
@Test public void testRegisterTabHandlers() { doReturn(registrations).when(tabPanel).getTabHandlerRegistrations(); doReturn(tabWidget).when(tab).getTabWidget(); doReturn(tabShowHandler).when(tabPanel).getIndividualTabShowHandler(); doReturn(tabShownHandler).when(tabPanel).getIndividualTabShownHandler(); doReturn(showHandlerRegistration).when(tabWidget).addShowHandler(tabShowHandler); doReturn(shownHandlerRegistration).when(tabWidget).addShownHandler(tabShownHandler); tabPanel.registerTabHandlers(tab); verify(registrations).put(tab, shownHandlerRegistration); verify(registrations).put(tab, showHandlerRegistration); }