docs: public static <E> int hIndex(Counter<E> citationCounts) {
      Counter<Integer> countCounts = new ClassicCounter<Integer>();
      for (double value : citationCounts.values()) {
        for (int i = 0; i <= value; ++i) {
          countCounts.incrementCount(i);
        }
      }
      List<Integer> citationCountValues = CollectionUtils.sorted(countCounts.keySet());
      Collections.reverse(citationCountValues);
      for (int citationCount : citationCountValues) {
        double occurrences = countCounts.getCount(citationCount);
        if (occurrences >= citationCount) {
          return citationCount;
        }
      }
      return 0;
    }