PropertiesHelper { public int getIntProperty(String key, int defaultValue) { final String value = properties.getProperty(key, String.valueOf(defaultValue)); return Integer.valueOf(value); } PropertiesHelper(Properties properties); boolean getBooleanProperty(String key, boolean defaultValue); int getIntProperty(String key, int defaultValue);  }
@Test public void getIntNoMatch() { final Properties properties = new Properties(); properties.put("key", "value"); assertEquals("No match so default value should be used", 2, createInstance(properties).getIntProperty("anotherKey", 2)); }
@Test public void getIntWithMatch() { final Properties properties = new Properties(); properties.put("key", "4"); assertEquals("Match so value should be used", 4, createInstance(properties).getIntProperty("key", 23)); }