hash code in Java

The official JavaDoc contract for hashCode() is harder to read than it needs to be. The three points in the contract boil down to these:
* Within the same program, the result of hashCode() must not change. This means that you shouldn’t include variables that change in figuring out the hash code. 
* If equals() returns true when called with two objects, calling hashCode() on each of those objects must return the same result. This means hashCode() can use a subset of the variables that equals() uses.
* If equals() returns false when called with two objects, calling hashCode() on each of those objects does not have to return a different result. This means hashCode() results do not need to be unique when called on unequal objects.