code: public static <K, V> String mapToString(Map<K, V> map) {
          Map<String, String> asStrings = map.entrySet()
                                             .stream()
                                             .collect(toMap(e -> e.getKey().toString(), e -> e.getValue().toString()));
          asStrings.forEach((k, v) -> {
              Preconditions.checkArgument(k == null || !((k.contains(",") || k.contains("="))), "Invalid key: %s", k);
              Preconditions.checkArgument(v == null || !((v.contains(",") || v.contains("="))), "Invalid value: %s", v);
          });
          return Joiner.on(", ").withKeyValueSeparator('=').join(asStrings);
      }
docs: Transforms a map into a string of the from:
  "K1=V1, K2=V2, K3=V3"
  Where the string versions of the key and value are derived from their toString() function.
  
  @param <K> The type of the keys of the map.
  @param <V> The type of the values of the map.
  @param map The map to be serialized to a string
  @return A string representation of the map.