Override both equals and hashcode