Add equals() and hashCode() implementation.