NamedEntity extends BaseEntity { public void setName(String name) { this.name = name; } NamedEntity();  NamedEntity(String name);  NamedEntity(NamedEntity clone); String getName(); void setName(String name); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void hashCodeAndEquals() { basicEqualsTest(entity); NamedEntity another = new NamedEntity(entity); assertEqualsAndHashCode(entity, another); another.setName(NAME_2); assertNotEqualsAndHashCode(entity, another); another.setName(NAME_UPPERCASE); assertEqualsAndHashCode(entity, another); }