title: Best practice for compareTo() when argument must be typed of super class
body: <p>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 </p>
  
  <pre><code>public int compareTo(BaseClass arg)
  </code></pre>
  
  <p>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?</p>
  
  <p>I know, the very best practices would be to define compareTo() only for the class it is, but that water is over the dam.</p>