code: protected URI buildUri(final String path, final List<NameValuePair> queryStringParams) {
          final StringBuilder sb = new StringBuilder();
          
          sb.append(path);
          if (queryStringParams != null && queryStringParams.size() > 0) {
              sb.append("?").append(URLEncodedUtils.format(queryStringParams, "UTF-8"));
          }
  
          try {
              return new URI(sb.toString());
          } catch (final URISyntaxException e) {
              throw new IllegalStateException("Invalid uri", e);
          }
      }
docs: Helper method to return URI query parameters
  
  @param path the path.
  @param queryStringParams the query string parameters.
  @return the URI object.