code: protected static String getMapAsString(Map<String, String> map, String separator) {
      if (map != null && !map.isEmpty()) {
        StringBuilder str = new StringBuilder();
        boolean isFirst = true;
        for (Entry<String, String> entry : map.entrySet() ) {
          if (!isFirst) {
            str.append(separator);
          } else {
            isFirst = false;
          }
          str.append(entry.getKey()).append(":").append(entry.getValue());
        }
        return str.toString();
      }
      return null;
    }
docs: Get string representation of the given map:
  key:value separator key:value separator ...
  @param map
  @param separator
  @return string representation of the given map