DeviceExtension implements Model { public void setLocalId(String localId) { this.localId = localId; }  String getLocalId(); void setLocalId(String localId); @Override void read(JSONObject object); @Override void write(JSONStringer writer); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void equalsHashCode() { DeviceExtension a = new DeviceExtension(); DeviceExtension b = new DeviceExtension(); checkEquals(a, b); a.setLocalId("a1"); checkNotEquals(a, b); b.setLocalId("b1"); checkNotEquals(a, b); b.setLocalId("a1"); checkEquals(a, b); }