code: public static URI addHttpParam(URI uri, String name, String value) {
          if (uri != null && name != null && value != null && ("http".equals(uri.getScheme()) || "https".equals(uri.getScheme()))) {
              final String base = uri.toASCIIString();
              final int queryIdx = base.indexOf('?');
              final int fragmentIdx = base.indexOf('#', queryIdx < 0 ? 0 : queryIdx);
              StringBuilder newUri = new StringBuilder(fragmentIdx >= 0 ? base.substring(0, fragmentIdx) : base);
              newUri.append(queryIdx < 0 ? '?' : '&');
              appendEncoded(newUri, name);
              newUri.append('=');
              appendEncoded(newUri, value);
              if (fragmentIdx >= 0) newUri.append(base, fragmentIdx, base.length());
              return URI.create(newUri.toString());
          }
          return uri;
      }
docs: This method adds a query parameter to an existing URI and takes care of proper encoding etc.
  <p>
  Since query parameters are scheme-specific, this method only applies to URI's with the following schemes:
  <ol>
  <li>{@code "http"}</li>
  <li>{@code "https"}</li>
  </ol>
  
  @param uri   The URI to add an HTTP parameter to
  @param name  The name of the parameter to add
  @param value The value of the parameter to add
  @return The URI to which a parameter may have been added