code: public static String queryString(Map<String, Object> values) {
          StringBuilder sbuf = new StringBuilder();
          String separator = "";
  
          for (Map.Entry<String, Object> entry : values.entrySet()) {
              Object entryValue = entry.getValue();
              if (entryValue instanceof Object[]) {
                  for (Object value : (Object[]) entryValue) {
                      appendParam(sbuf, separator, entry.getKey(), value);
                      separator = "&";
                  }
              } else if (entryValue instanceof Iterable) {
                  for (Object multiValue : (Iterable) entryValue) {
                      appendParam(sbuf, separator, entry.getKey(), multiValue);
                      separator = "&";
                  }
              } else {
                  appendParam(sbuf, separator, entry.getKey(), entryValue);
                  separator = "&";
              }
          }
  
          return sbuf.toString();
      }
docs: Convert a Map to a query string.
  @param values the map with the values
  <code>null</code> will be encoded as empty string, all other objects are converted to
  String by calling its <code>toString()</code> method.
  @return e.g. "key1=value&amp;key2=&amp;email=max%40example.com"