The hashCode( ), equals( Object obj), and toString( ) methods from the Java Object class are over written. It also implements the Serializable interface to make the object serializable (i.e. can be flattened to bytes).

As you could see, you need to implement the compare(Object obj1, Object obj2) method. This method has been written with fail fast in mind. As you can see, the input fields are validated, and exception is thrown if validation fails.