extended compareTo() to Objects