@Test public void testAddUrlPattern() throws Exception { Preferences preferences = new Preferences(); assertTrue(preferences.isUrlAcceptable("/test")); preferences.addUrlPattern("/test"); assertTrue(preferences.isUrlAcceptable("/test")); assertFalse(preferences.isUrlAcceptable("/test2")); }
public void addUrlPattern(String pattern) { if(urlPatterns == null) { urlPatterns = new ArrayList<String>(); } urlPatterns.add(pattern); }
Preferences { public void addUrlPattern(String pattern) { if(urlPatterns == null) { urlPatterns = new ArrayList<String>(); } urlPatterns.add(pattern); } }
Preferences { public void addUrlPattern(String pattern) { if(urlPatterns == null) { urlPatterns = new ArrayList<String>(); } urlPatterns.add(pattern); }  }
Preferences { public void addUrlPattern(String pattern) { if(urlPatterns == null) { urlPatterns = new ArrayList<String>(); } urlPatterns.add(pattern); }  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 addUrlPattern(String pattern) { if(urlPatterns == null) { urlPatterns = new ArrayList<String>(); } urlPatterns.add(pattern); }  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();  }