code: public static String getMapContents(Map m) {
          StringBuffer sb = new StringBuffer(1000);
          Object[] sortedArray = m.keySet().toArray();
          Arrays.sort(sortedArray);
  
          for (Object element : sortedArray) {
              sb.append(element.toString() + " - " + m.get(element) + System.getProperty("line.separator"));
          }
          return sb.toString();
      }
docs: Debug output an internal map structure as key-value pairs.
  @param m Must not be {@code null}.
  @return The resulting String of the contents of {@code m}.