@Test public void testHashCode() { Preferences p1 = new Preferences(); p1.addProperty("1", 1); p1.addProperty("true", true); p1.addUrlPattern("/test"); p1.addUrlPattern("/test2"); Preferences p2 = new Preferences(); Preferences p3 = new Preferences(); p3.addProperty("1", 1); p3.addProperty("true", true); p3.addUrlPattern("/test"); p3.addUrlPattern("/test2"); Set<Preferences> set = new HashSet<Preferences>(); set.add(p1); set.add(p2); set.add(p3); assertThat(set.size(), is(2)); }
@Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); }
Preferences { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } }
Preferences { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); }  }
Preferences { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); }  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 { @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); }  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();  }