PropertyFactory { public static String getProperty(final String key, final Properties properties) { return getProperty(key, properties, null); } private  PropertyFactory(); static Properties create(final String propertyResourceName); static Properties create(final String propertyResourceName, @Nullable final Class base); static String getProperty(final String key, final Properties properties); static String getProperty(final String key, final Properties properties, final String defaultValue);  }
@Test public void getProperty() throws Exception { Properties properties = PropertyFactory.create("/test.properties"); assertThat(PropertyFactory.getProperty("key1", properties), is("value1")); assertThat(PropertyFactory.getProperty("key2", properties), is("value2")); assertThat(PropertyFactory.getProperty("key3", properties), is(nullValue())); }