code: public static String getConcatenatedParameters(Map<String, String> parameters, String... keys) {
          StringBuilder keyValues = new StringBuilder();
          for(String key : keys) {
              String value = parameters.get(key.toLowerCase().trim());
              if(value!=null) {
                  if(keyValues.length()!=0) {
                      keyValues.append("&");
                  }
                  keyValues.append(key.toUpperCase());
                  keyValues.append("=");
                  keyValues.append(value);
              }
          }
          return keyValues.toString();
      }
docs: Create the Query part of an URI
  
  @param parameters Parameters to read
  @param keys map property to read
  
  @return Query part of an URI