code: public static <E> IntCounter<E> toRankCounter(Counter<E> c) {
      IntCounter<E> rankCounter = new IntCounter<E>();
      List<E> sortedList = toSortedList(c);
      for (int i = 0; i < sortedList.size(); i++) {
        rankCounter.setCount(sortedList.get(i), i);
      }
      return rankCounter;
    }
docs: Converts a counter to ranks
  
  @return A counter where the count is the rank in the original counter