In Hibernate documentation in chapter 4.3. "Implementing equals() and hashCode()" they wrote this sentence:
"Furthermore, if an instance is unsaved and currently in a Set, saving it will assign an identifier value to the object. If equals() and hashCode() are based on the identifier value, the hash code would change, breaking the contract of the Set."
I don't understand what contract it breaks and what problems can arrive from it.