code: public static <T> String toSortedString(Counter<T> counter, int k, String itemFormat, String joiner) {
      return toSortedString(counter, k, itemFormat, joiner, "%s");
    }
docs: Returns a string representation of a Counter, displaying the keys and their
  counts in decreasing order of count. At most k keys are displayed.
  
  @param counter
  A Counter.
  @param k
  The number of keys to include. Use Integer.MAX_VALUE to include
  all keys.
  @param itemFormat
  The format string for key/count pairs, where the key is first and
  the value is second. To display the value first, use argument
  indices, e.g. "%2$f %1$s".
  @param joiner
  The string used between pairs of key/value strings.
  @return The top k values from the Counter, formatted as specified.