QueryAttr implements Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (! (obj instanceof QueryAttr)) { return false; } QueryAttr other = (QueryAttr)obj; return new EqualsBuilder().append(name, other.name).append(path, other.path).append(type, other.type).isEquals(); } QueryAttr(String path, Class<?> type);  QueryAttr(String name, String path, Class<?> type);  QueryAttr(String name, String path, Class<?> type, String title); String getName(); String getTitle(); String getPath(); Class<?> getType(); void setTitle(String title); @Override QueryAttr clone(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testEquals() { assertEquals(a1, a1); assertEquals(a1, a1again); assertFalse(a1.equals(a2)); }