OwnedEntity extends NamedEntity { public void setUserId(String userId) { this.userId = userId; } OwnedEntity();  OwnedEntity(String name);  OwnedEntity(String userId, String name);  OwnedEntity(OwnedEntity clone); String getUserId(); void setUserId(String userId); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void hashCodeAndEquals() { basicEqualsTest(entity); OwnedEntity another = new OwnedEntity(entity); assertEqualsAndHashCode(entity, another); another.setUserId(USER_ID_2); assertNotEqualsAndHashCode(entity, another); another.setUserId(USER_ID_UPPERCASE); assertEqualsAndHashCode(entity, another); }