code: public String concatQueryString(Map<String, String> parameters)
          throws UnsupportedEncodingException {
          if (null == parameters) {
              return null;
          }
  
          StringBuilder urlBuilder = new StringBuilder("");
          for (Map.Entry<String, String> entry : parameters.entrySet()) {
              String key = entry.getKey();
              String val = entry.getValue();
              urlBuilder.append(encode(key));
              if (val != null) {
                  urlBuilder.append("=").append(encode(val));
              }
              urlBuilder.append("&");
          }
  
          int strIndex = urlBuilder.length();
          if (parameters.size() > 0) {
              urlBuilder.deleteCharAt(strIndex - 1);
          }
  
          return urlBuilder.toString();
      }
docs: concate query string parameters (e.g. name=foo)
  
  @param parameters query parameters
  @return concatenated query string
  @throws UnsupportedEncodingException exceptions