I'm looking for best practice for the definition of the compareTo() method in the case where the class implements Comparable. Thus, the signature of the method has to be
public int compareTo(BaseClass arg)
The obvious thing to do first is check if the arg is an instanceof this class, and if so, cast to the class, and compare the members. But if the argument is not of this class, but rather some other class that also implements BaseClass, what do I return so that its reflexive?
I know, the very best practices would be to define compareTo() only for the class it is, but that water is over the dam.