I am using Java 7, and I have the following class below. I implemented equals and hashCode correctly, but the problem is that equals r
equals
hashCode
it's not necessary for two unequal objects to have different hashes, the important thing is to have the same hash for two equal objects.
I can implement hashCode() like this :
public int hashCode() { return 5; }
and it will stay correct (but inefficient).