FilterPagedTable extends Composite { public void addTab(final PagedTable<T> grid, final String key, final Command filterCommand) { addTab(grid, key, filterCommand, true); } FilterPagedTable();  FilterPagedTable(MultiGridPreferencesStore gridsPreferences); void removeTab(String gridKey); String getValidKeyForAdditionalListGrid(String baseName); void createNewTab(PagedTable<T> pagedTable,
                             final String key,
                             Button button,
                             Command filterCommand); void addTab(final PagedTable<T> grid,
                       final String key,
                       final Command filterCommand); void addTab(final PagedTable<T> grid,
                       final String key,
                       final Command filterCommand,
                       final boolean selectTab); void addAddTableButton(Button addTableButton); Widget makeWidget(); MultiGridPreferencesStore getMultiGridPreferencesStore(); void setMultiGridPreferencesStore(MultiGridPreferencesStore multiGridPreferencesStore); void setPreferencesService(Caller<UserPreferencesService> preferencesService); void setSelectedTab(); void saveTabSettings(String key,
                                HashMap<String, Object> params); void saveNewTabSettings(String key,
                                   HashMap<String, Object> params); void saveNewRefreshInterval(int newValue); int getRefreshInterval(); void setRefreshGridCommand(Command refreshGridCommand); void removeTab(int index); public Command refreshGridCommand; }
@Test public void testAddTab() throws Exception { when(navTabs.getWidget(anyInt())).thenReturn(tabListItem); filterPagedTable.addTab(pagedTableMock, "base", mock(Command.class)); verify(tabListItem, times(1)).showTab(); filterPagedTable.addTab(pagedTableMock, "base", mock(Command.class), true); verify(tabListItem, times(2)).showTab(); filterPagedTable.addTab(pagedTableMock, "base", mock(Command.class), false); verify(tabListItem, times(2)).showTab(); }