SettingsRepositoryImpl implements SettingsRepository { @Override public Set<String> unset(String data) { Set<String> errors = new HashSet<>(); Map<String, Set<String>> values = TextUtils.parseAssignment(data); values.keySet().forEach( k -> { String enumName = k.toUpperCase(); if (Field.contains(enumName)) { Field field = Field.valueOf(enumName); filtersAware.unsetFilter(field); requestPromptRefresh(); } else if (Setting.contains(enumName)) { Setting setting = Setting.valueOf(enumName); settingsAware.unsetSetting(setting); } else { errors.add(String.format("Filter or setting with name = %s not found", k)); } } ); return errors; }  @Override Set<String> set(String data); @Override Set<String> unset(String data); @Override Map<String, String> showSettings(boolean all); @Override Map<String, String> showFilters(boolean all);  }
@Test public void testUnsetMissingSetting() { assertThat(settingsRepository.unset("missing_key"), hasSize(1)); }