Implement equals in Comparator to avoid compile failing in JDK 5