code: public String format(Map<?, ?> map, char keyValueSeparator) {
      if (map == null) {
        return StringUtils.EMPTY;
      }
      Preconditions.checkArgument(keyValueSeparator != ' ');
  
      StringBuilder rowString = new StringBuilder();
      for (Iterator<?> itr = map.entrySet().iterator(); itr.hasNext(); ) {
        Map.Entry<?, ?> entry = Cast.as(itr.next());
        String key = entry.getKey() == null ? "null" : entry.getKey().toString();
        String value = entry.getValue() == null ? "null" : entry.getValue().toString();
  
        key = key.replaceAll(Pattern.quote(escape), doubleEscape + doubleEscape);
        value = value.replaceAll(Pattern.quote(escape), doubleEscape + doubleEscape);
  
        rowString.append(quote);
  
        if (key.indexOf(keyValueSeparator) >= 0) {
          rowString.append(doubleQuote).append(key.replaceAll(quote, doubleQuote))
                   .append(doubleQuote);
        } else {
          rowString.append(key.replaceAll(quote, doubleQuote));
        }
  
        rowString.append(keyValueSeparator);
  
        if (value.indexOf(keyValueSeparator) >= 0) {
          rowString.append(doubleQuote).append(value.replaceAll(quote, doubleQuote))
                   .append(doubleQuote);
        } else {
          rowString.append(value.replaceAll(quote, doubleQuote));
        }
  
        rowString.append(quote);
  
        if (itr.hasNext()) {
          rowString.append(delimiter);
        }
  
      }
  
      return rowString.toString();
    }
docs: Formats the items in a <code>Map</code>.
  
  @param map               The Map to format
  @param keyValueSeparator the character to use to separate keys and values
  @return A String representing the single DSV formatted row of Map entries