code: public int compareTo(java.util.Date o) {
         if(o instanceof Timestamp) {
              // When Timestamp instance compare it with a Timestamp
              // Hence it is basically calling this.compareTo((Timestamp))o);
              // Note typecasting is safe because o is instance of Timestamp
             return compareTo((Timestamp)o);
        } else {
              // When Date doing a o.compareTo(this)
              // will give wrong results.
            Timestamp ts = new Timestamp(o.getTime());
            return this.compareTo(ts);
        }
      }
docs: Compares this <code>Timestamp</code> object to the given
  <code>Date</code> object.
  
  @param o the <code>Date</code> to be compared to
  this <code>Timestamp</code> object
  @return  the value <code>0</code> if this <code>Timestamp</code> object
  and the given object are equal; a value less than <code>0</code>
  if this  <code>Timestamp</code> object is before the given argument;
  and a value greater than <code>0</code> if this
  <code>Timestamp</code> object is after the given argument.
  
  @since   1.5