Tutorials

Testing equals() and hashCode()

When you working with Java Beans you almost certainly overwrite the equals(), hashCode() methods. But how to test them? The equals contract which is described in the JavaDoc of the Object class is …