Rule 1: The connection between hashCode() and equals():
If x.equals(y), then x.hashCode() must be same as y.hashCode().
Rule 2: Overwriting hashCode() or equals():
If you overwrite one of these functions, you have to overwrite the second too.
When you need to overwrite equals?