SimpleTable extends UberfireSimpleTable<T> { public void saveGridToUserPreferences(){ if (preferencesService!=null && gridPreferencesStore != null) { gridPreferencesStore.setType(UserPreferencesType.GRIDPREFERENCES); preferencesService.call(response -> { }).saveUserPreferences(gridPreferencesStore); } } SimpleTable();  SimpleTable(final ProvidesKey<T> providesKey);  SimpleTable(final ProvidesKey<T> providesKey,
                       final GridGlobalPreferences gridGlobalPreferences); void setPersistPreferencesOnChange(boolean persistPreferencesOnChange); boolean isPersistingPreferencesOnChange(); void setPreferencesService(final Caller<UserPreferencesService> preferencesService); GridPreferencesStore getGridPreferencesStore(); void setGridPreferencesStore(final GridPreferencesStore gridPreferences); void saveGridPreferences(); void saveGridToUserPreferences(); void storeColumnToPreferences();  }
@Test public void testSaveUserPreferencesUsingPreferencesKey() { String newKey = "newKey"; gridPreferencesStore.setPreferenceKey(newKey); simpleTable.saveGridToUserPreferences(); ArgumentCaptor<UserPreference> argumentCaptor = ArgumentCaptor.forClass(UserPreference.class); verify(userPreferencesServiceMock).saveUserPreferences(argumentCaptor.capture()); assertEquals(newKey, argumentCaptor.getValue().getPreferenceKey()); assertEquals(UserPreferencesType.GRIDPREFERENCES, argumentCaptor.getValue().getType()); }