PropertiesSettingsProvider implements SettingsProvider { @Override public Optional<String> get(String settingName) { return Optional.ofNullable(properties.getProperty(settingName)); } PropertiesSettingsProvider(Properties properties); @Override Optional<String> get(String settingName); @Override List<String> getList(String settingName, List<String> defaultValue); @Override Optional<T> getAs(String settingName, Class<T> cls);  }
@Test public void testGet() throws Exception { assertThat(settingsProvider.get(MISSING_KEY).isPresent(), is(false)); assertThat(settingsProvider.get(EXISTING_KEY), equalTo(Optional.of(VALUE))); }