URIBuilder { public URIBuilder addParameter(final String param, final String value) { if (this.queryParams == null) { this.queryParams = new ArrayList<>(); } this.queryParams.add(new BasicNameValuePair(param, value)); this.encodedQuery = null; this.encodedSchemeSpecificPart = null; this.query = null; return this; } URIBuilder();  URIBuilder(final String string);  URIBuilder(final URI uri);  URIBuilder(final String string, final Charset charset);  URIBuilder(final URI uri, final Charset charset); static URIBuilder localhost(); static URIBuilder loopbackAddress(); URIBuilder setCharset(final Charset charset); Charset getCharset(); URI build(); URIBuilder setScheme(final String scheme); URIBuilder setSchemeSpecificPart(final String schemeSpecificPart); URIBuilder setSchemeSpecificPart(final String schemeSpecificPart, final NameValuePair... nvps); URIBuilder setSchemeSpecificPart(final String schemeSpecificPart, final List <NameValuePair> nvps); URIBuilder setUserInfo(final String userInfo); @Deprecated URIBuilder setUserInfo(final String username, final String password); URIBuilder setHost(final InetAddress host); URIBuilder setHost(final String host); URIBuilder setHttpHost(final HttpHost httpHost ); URIBuilder setPort(final int port); URIBuilder setPath(final String path); URIBuilder setPathSegments(final String... pathSegments); URIBuilder setPathSegmentsRootless(final String... pathSegments); URIBuilder setPathSegments(final List<String> pathSegments); URIBuilder setPathSegmentsRootless(final List<String> pathSegments); URIBuilder removeQuery(); URIBuilder setParameters(final List <NameValuePair> nvps); URIBuilder addParameters(final List <NameValuePair> nvps); URIBuilder setParameters(final NameValuePair... nvps); URIBuilder addParameter(final String param, final String value); URIBuilder setParameter(final String param, final String value); URIBuilder clearParameters(); URIBuilder setCustomQuery(final String query); URIBuilder setFragment(final String fragment); boolean isAbsolute(); boolean isOpaque(); String getScheme(); String getSchemeSpecificPart(); String getUserInfo(); String getHost(); int getPort(); boolean isPathEmpty(); List<String> getPathSegments(); String getPath(); boolean isQueryEmpty(); List<NameValuePair> getQueryParams(); String getFragment(); @Override String toString();  }
@Test public void testAddParameter() throws Exception { final URI uri = new URI("http", null, "localhost", 80, "/", "param=stuff&blah&blah", null); final URIBuilder uribuilder = new URIBuilder(uri).addParameter("param", "some other stuff") .addParameter("blah", "blah"); final URI result = uribuilder.build(); Assert.assertEquals(new URI("http: "param=some%20other%20stuff&blah=blah"), result); }