URIUtils { public static URI rewriteURI( final URI uri, final HttpHost target, boolean dropFragment) throws URISyntaxException { if (uri == null) { throw new IllegalArgumentException("URI may nor be null"); } if (target != null) { return URIUtils.createURI( target.getSchemeName(), target.getHostName(), target.getPort(), normalizePath(uri.getRawPath()), uri.getRawQuery(), dropFragment ? null : uri.getRawFragment()); } else { return URIUtils.createURI( null, null, -1, normalizePath(uri.getRawPath()), uri.getRawQuery(), dropFragment ? null : uri.getRawFragment()); } } private  URIUtils(); static URI createURI(
            final String scheme,
            final String host,
            int port,
            final String path,
            final String query,
            final String fragment); static URI rewriteURI(
            final URI uri,
            final HttpHost target,
            boolean dropFragment); static URI rewriteURI(
            final URI uri,
            final HttpHost target); static URI resolve(final URI baseURI, final String reference); static URI resolve(final URI baseURI, URI reference); static HttpHost extractHost(final URI uri);  }
@Test public void testRewite00() throws Exception { URI uri = URI.create("http: HttpHost target = new HttpHost("thathost", -1); Assert.assertEquals("http: }
@Test public void testRewite01() throws Exception { URI uri = URI.create("http: Assert.assertEquals("/stuff", URIUtils.rewriteURI(uri, null).toString()); }
@Test public void testRewite02() throws Exception { URI uri = URI.create("http: Assert.assertEquals("/", URIUtils.rewriteURI(uri, null).toString()); }
@Test public void testRewite03() throws Exception { URI uri = URI.create("http: Assert.assertEquals("/stuff }
@Test public void testRewite04() throws Exception { URI uri = URI.create("http: HttpHost target = new HttpHost("thathost", -1); Assert.assertEquals("http: }
@Test public void testRewite05() throws Exception { URI uri = URI.create("http: HttpHost target = new HttpHost("thathost", -1); Assert.assertEquals("http: }
@Test public void testRewite06() throws Exception { URI uri = URI.create("http: Assert.assertEquals("/stuff/", URIUtils.rewriteURI(uri, null).toString()); }