TabPanelWithDropdowns extends Composite { void insertTabAndContent(final TabPanelEntry tab, final int index) { final TabPanelEntry.DropDownTabListItem tabWidget = tab.getTabWidget(); final TabPane tabContentPane = tab.getContentPane(); getTabBar().insert(tab.getTabWidget(), index); getAllContentTabs().add(tab); getTabContent().add(tabContentPane); getActivatableWidgets().add(tabWidget); }  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 testInsertTabAndContent() { final int index = 1; final TabPane tabContentPane = mock(TabPane.class); final NavTabs tabBar = mock(NavTabs.class); final TabContent tabContent = mock(TabContent.class); final Set<TabPanelEntry> allContentTabs = spy(new HashSet<>()); final Set<Widget> activatableWidgets = spy(new HashSet<>()); doReturn(tabWidget).when(tab).getTabWidget(); doReturn(tabContentPane).when(tab).getContentPane(); doReturn(tabBar).when(tabPanel).getTabBar(); doReturn(tabContent).when(tabPanel).getTabContent(); doReturn(allContentTabs).when(tabPanel).getAllContentTabs(); doReturn(activatableWidgets).when(tabPanel).getActivatableWidgets(); tabPanel.insertTabAndContent(tab, index); verify(tabBar).insert(tab.getTabWidget(), index); verify(allContentTabs).add(tab); verify(tabContent).add(tabContentPane); verify(activatableWidgets).add(tabWidget); }