AbstractEntity implements Cloneable,
        IModifiedDateEntity, ICreatedDateEntity { public final int hashCode() { return new HashCodeBuilder(17, 37) .append(getId()) .append(this.getClass().getName()) .toHashCode(); }  final BigInteger getId(); final void setId(final BigInteger id); final Calendar getCreatedDate(); final void setCreatedDate(final Calendar date); final Calendar getModifiedDate(); final void setModifiedDate(final Calendar date); final boolean equals(final Object o); final int hashCode(); final String toString(); @Override final Object clone();  }
@Test public void testHashCode() { BigInteger id = IdUtil.next(); AbstractEntity a = new TestEntity(); a.setId(id); AbstractEntity b = new TestEntity(); b.setId(id); AbstractEntity c = new TestEntity(); c.setId(IdUtil.next()); AbstractEntity d = new TestEntity(); AbstractEntity e = new TestChildEntity(); e.setId(IdUtil.next()); assertEquals(a.hashCode(), b.hashCode()); assertNotEquals(a.hashCode(), c.hashCode()); assertNotEquals(a.hashCode(), d.hashCode()); assertNotEquals(a.hashCode(), e.hashCode()); }