TypedProperty implements Model { public void setName(String name) { this.name = name; }  abstract String getType(); String getName(); void setName(String name); @Override void read(JSONObject object); @Override void write(JSONStringer writer); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void equalsHashCode() { TypedProperty a = new MockTypedProperty(); TypedProperty b = new MockTypedProperty(); checkNotEquals(a, null); checkNotEquals(a, new Object()); checkEquals(a, a); checkEquals(a, b); a.setName("name"); checkNotEquals(a, b); b.setName("name"); checkEquals(a, b); }