code: @SuppressWarnings("unchecked")
      final int compare(Object k1, Object k2) {
          return comparator==null ? ((Comparable<? super K>)k1).compareTo((K)k2)
              : comparator.compare((K)k1, (K)k2);
      }
docs: Compares two keys using the correct comparison method for this TreeMap.