Contract of hashCode() and equals() methods is as follows in Java:
If object1.equals(object2), then object1.hashCode() ==
object2.hashCode() should always be true. It means if two objects
are equal then their hashCode should be same.
If object1.hashCode() == object2.hashCode() is true, it does not
guarantee that object1.equals(object2). It means if two objects have
same hashCode, then can still have different values so that may not
be equal objects