MultiPageEditorViewImpl extends ResizeTabPanel implements MultiPageEditorView { @Override public void disablePage(int index) { if (!isValid(index)) { return; } final Widget tab = getTabBar().getWidget(index); tab.addStyleName("disabled"); disableWidget(tab); }  @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 testDisablePage() { final int index = 1; final Widget widget = mock(Widget.class); final NavTabs navTabs = mock(NavTabs.class); final Element element = mock(Element.class); final Style style = mock(Style.class); doReturn(navTabs).when(view).getTabBar(); doReturn(widget).when(navTabs).getWidget(index); doReturn(element).when(widget).getElement(); doReturn(style).when(element).getStyle(); doReturn(true).when(view).isValid(anyInt()); view.disablePage(index); verify(widget).addStyleName("disabled"); verify(style).setProperty("pointerEvents", "none"); }