docs: public static <E> List<Pair<E, Double>> toSortedListWithCounts(Counter<E> c) {
      List<Pair<E, Double>> l = new ArrayList<Pair<E, Double>>(c.size());
      for (E e : c.keySet()) {
        l.add(new Pair<E, Double>(e, c.getCount(e)));
      }
      // descending order
      Collections.sort(l, new Comparator<Pair<E, Double>>() {
        public int compare(Pair<E, Double> a, Pair<E, Double> b) {
          return Double.compare(b.second, a.second);
        }
      });
      return l;
    }