Adds equals and hashCode.