code: public static String printMap(Map<? extends Object, ? extends Object> tagCountForAllApps, boolean valueFirst)
      {
          StringBuilder sb = new StringBuilder();
          for (Map.Entry<? extends Object, ? extends Object> e : tagCountForAllApps.entrySet())
          {
              sb.append("  ");
              sb.append(valueFirst ? e.getValue() : e.getKey());
              sb.append(": ");
              sb.append(valueFirst ? e.getKey() : e.getValue());
              sb.append(Util.NL);
          }
          return sb.toString();
      }
docs: Formats a Map to a String, each entry as one line, using toString() of keys and values.