@Test public void testAddProperty() throws Exception { Preferences preferences = new Preferences(); preferences.addProperty("1", 1); preferences.addProperty("true", true); assertThat(preferences.isEnabled("true"), is(true)); assertThat(preferences.isEnabled("not existing"), is(false)); assertThat(preferences.getIntValue("1"), is(1)); assertThat(preferences.getIntValue("not existsing"), CoreMatchers.<Object>nullValue()); }
public void addProperty(String name, boolean value) { if(MapUtils.isEmpty(booleanProperties)) { booleanProperties = new HashMap<String, Boolean>(); } booleanProperties.put(name, value); }
Preferences { public void addProperty(String name, boolean value) { if(MapUtils.isEmpty(booleanProperties)) { booleanProperties = new HashMap<String, Boolean>(); } booleanProperties.put(name, value); } }
Preferences { public void addProperty(String name, boolean value) { if(MapUtils.isEmpty(booleanProperties)) { booleanProperties = new HashMap<String, Boolean>(); } booleanProperties.put(name, value); }  }
Preferences { public void addProperty(String name, boolean value) { if(MapUtils.isEmpty(booleanProperties)) { booleanProperties = new HashMap<String, Boolean>(); } booleanProperties.put(name, value); }  Map<String, Boolean> getBooleanProperties(); void addProperty(String name, boolean value); void addProperty(String name, int value); void addUrlPattern(String pattern); void setBooleanProperties(Map<String, Boolean> booleanProperties); Map<String, Integer> getIntegerProperties(); void setIntegerProperties(Map<String, Integer> integerProperties); List<String> getUrlPatterns(); void setUrlPatterns(List<String> urlPatterns); boolean isUrlAcceptable(String url); boolean isEnabled(String property); boolean isRegexEnabled(String name); Integer getIntValue(String property); @Override boolean equals(Object o); @Override int hashCode(); }
Preferences { public void addProperty(String name, boolean value) { if(MapUtils.isEmpty(booleanProperties)) { booleanProperties = new HashMap<String, Boolean>(); } booleanProperties.put(name, value); }  Map<String, Boolean> getBooleanProperties(); void addProperty(String name, boolean value); void addProperty(String name, int value); void addUrlPattern(String pattern); void setBooleanProperties(Map<String, Boolean> booleanProperties); Map<String, Integer> getIntegerProperties(); void setIntegerProperties(Map<String, Integer> integerProperties); List<String> getUrlPatterns(); void setUrlPatterns(List<String> urlPatterns); boolean isUrlAcceptable(String url); boolean isEnabled(String property); boolean isRegexEnabled(String name); Integer getIntValue(String property); @Override boolean equals(Object o); @Override int hashCode();  }