code: protected static CharSequence delimit(Collection<Map.Entry<String, CharSequence>> entries,
                                          CharSequence delimiter, CharSequence equals,
                                          boolean doEncode) {
      if (entries == null || entries.isEmpty())
        return null;
  
      StringBuilder buffer = new StringBuilder();
      boolean notFirst = false;
      for (Map.Entry<String, CharSequence> entry : entries) {
        if (notFirst)
          buffer.append(delimiter);
        else
          notFirst = true;
        CharSequence value = entry.getValue();
        buffer.append(entry.getKey()).append(equals).append(doEncode ? encode(value) : value);
      }
      return buffer;
    }
docs: Delimits a collection entries into a single CharSequence, using <code>delimiter</code>
  to delimit each entry, and <code>equals</code> to delimit the key from the value inside
  each entry.
  @param entries
  @param delimiter used to delimit one entry from another
  @param equals used to delimit key from value
  @param doEncode whether to encode the value of each entry
  @return a CharSequence that contains all the entries, appropriately delimited