code: public static <E> String toVerticalString(Counter<E> c, int k, String fmt, boolean swap) {
      PriorityQueue<E> q = Counters.toPriorityQueue(c);
      List<E> sortedKeys = q.toSortedList();
      StringBuilder sb = new StringBuilder();
      int i = 0;
      for (Iterator<E> keyI = sortedKeys.iterator(); keyI.hasNext() && i < k; i++) {
        E key = keyI.next();
        double val = q.getPriority(key);
        if (swap) {
          sb.append(String.format(fmt, key, val));
        } else {
          sb.append(String.format(fmt, val, key));
        }
        if (keyI.hasNext()) {
          sb.append('\n');
        }
      }
      return sb.toString();
    }
docs: Returns a <code>String</code> representation of the <code>k</code> keys
  with the largest counts in the given {@link Counter}, using the given
  format string.
  
  @param c
  a Counter
  @param k
  how many keys to print
  @param fmt
  a format string, such as "%.0f\t%s" (do not include final "%n")
  @param swap
  whether the count should appear after the key