UriBuilderImpl extends UriBuilder { @Override public UriBuilder replaceQueryParam(String name, Object... values) { checkSsp(); if (queryParams == null) { queryParams = UriComponent.decodeQuery(query.toString(), false, false); query.setLength(0); } name = encode(name, UriComponent.Type.QUERY_PARAM); queryParams.remove(name); if (values == null) { return this; } for (Object value : values) { if (value == null) { throw new IllegalArgumentException("One or more of query value parameters are null"); } queryParams.add(name, encode(value.toString(), UriComponent.Type.QUERY_PARAM)); } return this; } UriBuilderImpl(); private  UriBuilderImpl(UriBuilderImpl that); @Override UriBuilder clone(); @Override UriBuilder uri(URI uri); @Override UriBuilder scheme(String scheme); @Override UriBuilder schemeSpecificPart(String ssp); @Override UriBuilder userInfo(String ui); @Override UriBuilder host(String host); @Override UriBuilder port(int port); @Override UriBuilder replacePath(String path); @Override UriBuilder path(String path); @Override UriBuilder path(Class resource); @Override UriBuilder path(Class resource, String methodName); @Override UriBuilder path(Method method); @Override UriBuilder segment(String... segments); @Override UriBuilder replaceMatrix(String matrix); @Override UriBuilder matrixParam(String name, Object... values); @Override UriBuilder replaceMatrixParam(String name, Object... values); @Override UriBuilder replaceQuery(String query); @Override UriBuilder queryParam(String name, Object... values); @Override UriBuilder replaceQueryParam(String name, Object... values); @Override UriBuilder fragment(String fragment); @Override URI buildFromMap(Map<String, ? extends Object> values); @Override URI buildFromEncodedMap(Map<String, ? extends Object> values); @Override URI build(Object... values); @Override URI buildFromEncoded(Object... values);  }
@Test public void testReplaceQueryParam() { URI uri = new UriBuilderImpl().path("http: assertEquals("http: }