@Test
    void testHttpLocationWithRelativeFragment() throws Exception {
        final HttpHost target = new HttpHost("http", "localhost", -1);
        final URI requestURI = new URI("/stuff#blahblah");

        final URI location = URIUtils.resolve(requestURI, target, null);
        final URI expectedURI = new URIBuilder(requestURI)
                .setHost(target.getHostName())
                .setScheme(target.getSchemeName())
                .build();
        Assertions.assertEquals(expectedURI, location);
    }
This TestCase contains test methods for URI resolving according to RFC 3986.
The examples are listed in section "5.4 Reference Resolution Examples"
httpclient5/src/test/java/org/apache/hc/client5/http/utils/TestURIUtils.java