Normally, hashcode and equal are used to implement own equal rules. unique value field is used in hashcode calculation. hashcode is used in hashing api like hashmap.
As per equal and hashcode contract if two object are equal then their hashcode must be same and they will go in same bucket.
In real time use x should be unique in your case
for your reference