code: public static <K extends Comparable<K>, V> String toStringSorted(Map<K, V> map) {
      StringBuilder builder = new StringBuilder();
      toStringSorted(map, builder);
      return builder.toString();
    }
docs: Stringifies a Map in a stable fashion.