docs: public static <E extends Comparable<E>> Comparator<E> toComparatorWithKeys(final Counter<E> counter) {
      return new Comparator<E>() {
        public int compare(E o1, E o2) {
          int res = Double.compare(counter.getCount(o1), counter.getCount(o2));
          if (res == 0) {
            return o1.compareTo(o2);
          } else {
            return res;
          }
        }
      };
    }