The equals method reused the compareTo method.