MultiPageEditorViewImpl extends ResizeTabPanel implements MultiPageEditorView { void setAsActive(final TabPanelEntry tab) { if (this.getActiveTab() == null) { tab.showTab(); tab.setActive(true); } }  @Override void init(); void enableSelectedPageEvent(final Event<MultiPageEditorSelectedPageEvent> selectedPageEvent); void addPage(final Page page); @Override void addPage(int index, final Page page); void selectPage(int index); int selectedPage(); @Override void disablePage(int index); @Override void enablePage(int index); @Override int getPageIndex(final String title);  }
@Test public void testSetAsActiveWhenActiveTabIsNull() { doReturn(null).when(view).getActiveTab(); view.setAsActive(tab); verify(tab).showTab(); verify(tab).setActive(true); }
@Test public void testSetAsActiveWhenActiveTabIsNotNull() { doReturn(mock(TabPanelEntry.class)).when(view).getActiveTab(); view.setAsActive(tab); verify(tab, never()).showTab(); verify(tab, never()).setActive(true); }