Whoever designs a class must decide how its instances are considered "equivalent" or not.. That is implicit in what it says about
Object#equals(java.lang.Object) in the API documentation. It says in the
java.util.Set documentation that Sets don't contain duplicates. Remember duplicates can only be identified if the equals method is used.
My copy of Deitel (6th edition, page 451) says "a class that overrides
equals should also override
hashCode", and comments about the overridden
equals method at the top of page 910.