docs: public static <A, B extends Comparable<B>> Map<A, B> sortByValue(Map<A, B> map) {
      List<Map.Entry<A, B>> list = Lists.newArrayList(map.entrySet());
      Collections.sort(list, new Comparator<Map.Entry<A, B>>() {
        public int compare(Map.Entry<A, B> o1, Map.Entry<A, B> o2) {
          return o1.getValue().compareTo(o2.getValue());
        }
      });
      return listToMap(list);
    }