code: public URI forURL(URI uri) {
          QueryStringEncoder encoder = new QueryStringEncoder(uri.toString());
          for (Map.Entry<String, Object> e : params.entrySet()) {
              encoder.addParam(e.getKey(), String.valueOf(e.getValue()));
          }
          try {
              return encoder.toUri();
          } catch (URISyntaxException e) {
              throw new IllegalArgumentException("Cannot construct a query string from the given params. " +
                      "An invalid parameter was used.");
          }
      }
docs: /*
  @param uri A URL to which the query string will be appended
  @return a URI with the query string configured with params of this object