Equals/hashCode method contracts paraphrased.
reflexive: x.equals(x) is true for all x, except null
symmetric: x.equals(y) is true for all x, y where y.equals(x) is true
transitive: x.equals(z) is true for all x, y, z where x.equals(y) is true and y.equals(z) is true
consistent: x.equals(y) returns the same value on multiple invocations if the object has the same state with respect to how it specifies equality.
x.equals(null) is false for all x
x.hashCode() == y.hashCode for all x, y where x.equals(y)
The actual method contracts are specified in the API Specification for java.lang.Object:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html This is the definitive source of the contracts - anything else (including my paraphrasing) is an extrapolation from truth and should be approached with caution.
This software will assist you in meeting these contracts:
http://www.jtiger.org/ Specifically, the assertions package:
http://www.jtiger.org/javadoc/org/jtiger/assertion/EqualsMethodContract.html http://www.jtiger.org/javadoc/org/jtiger/assertion/HashCodeMethodContract.html