@Test
    void testResolve() {
        Assertions.assertEquals("g:h", URIUtils.resolve(this.baseURI, "g:h").toString());
        Assertions.assertEquals("http://a/b/c/g", URIUtils.resolve(this.baseURI, "g").toString());
        Assertions.assertEquals("http://a/b/c/g", URIUtils.resolve(this.baseURI, "./g").toString());
        Assertions.assertEquals("http://a/b/c/g/", URIUtils.resolve(this.baseURI, "g/").toString());
        Assertions.assertEquals("http://a/g", URIUtils.resolve(this.baseURI, "/g").toString());
        Assertions.assertEquals("http://g/", URIUtils.resolve(this.baseURI, "//g").toString());
        Assertions.assertEquals("http://a/b/c/d;p?y", URIUtils.resolve(this.baseURI, "?y").toString());
        Assertions.assertEquals("http://a/b/c/d;p?y#f", URIUtils.resolve(this.baseURI, "?y#f")
                .toString());
        Assertions.assertEquals("http://a/b/c/g?y", URIUtils.resolve(this.baseURI, "g?y").toString());
        Assertions.assertEquals("http://a/b/c/d;p?q#s", URIUtils.resolve(this.baseURI, "#s")
                .toString());
        Assertions.assertEquals("http://a/b/c/g#s", URIUtils.resolve(this.baseURI, "g#s").toString());
        Assertions.assertEquals("http://a/b/c/g?y#s", URIUtils.resolve(this.baseURI, "g?y#s")
                .toString());
        Assertions.assertEquals("http://a/b/c/;x", URIUtils.resolve(this.baseURI, ";x").toString());
        Assertions.assertEquals("http://a/b/c/g;x", URIUtils.resolve(this.baseURI, "g;x").toString());
        Assertions.assertEquals("http://a/b/c/g;x?y#s", URIUtils.resolve(this.baseURI, "g;x?y#s")
                .toString());
        Assertions.assertEquals("http://a/b/c/d;p?q", URIUtils.resolve(this.baseURI, "").toString());
        Assertions.assertEquals("http://a/b/c/", URIUtils.resolve(this.baseURI, ".").toString());
        Assertions.assertEquals("http://a/b/c/", URIUtils.resolve(this.baseURI, "./").toString());
        Assertions.assertEquals("http://a/b/", URIUtils.resolve(this.baseURI, "..").toString());
        Assertions.assertEquals("http://a/b/", URIUtils.resolve(this.baseURI, "../").toString());
        Assertions.assertEquals("http://a/b/g", URIUtils.resolve(this.baseURI, "../g").toString());
        Assertions.assertEquals("http://a/", URIUtils.resolve(this.baseURI, "../..").toString());
        Assertions.assertEquals("http://a/", URIUtils.resolve(this.baseURI, "../../").toString());
        Assertions.assertEquals("http://a/g", URIUtils.resolve(this.baseURI, "../../g").toString());
        Assertions.assertEquals("http://a/../g", URIUtils.resolve(this.baseURI, "../../../g").toString());
        Assertions.assertEquals("http://a/../../g", URIUtils.resolve(this.baseURI, "../../../../g")
                .toString());
        Assertions.assertEquals("http://a/./g", URIUtils.resolve(this.baseURI, "/./g").toString());
        Assertions.assertEquals("http://a/../g", URIUtils.resolve(this.baseURI, "/../g").toString());
        Assertions.assertEquals("http://a/b/c/g.", URIUtils.resolve(this.baseURI, "g.").toString());
        Assertions.assertEquals("http://a/b/c/.g", URIUtils.resolve(this.baseURI, ".g").toString());
        Assertions.assertEquals("http://a/b/c/g..", URIUtils.resolve(this.baseURI, "g..").toString());
        Assertions.assertEquals("http://a/b/c/..g", URIUtils.resolve(this.baseURI, "..g").toString());
        Assertions.assertEquals("http://a/b/g", URIUtils.resolve(this.baseURI, "./../g").toString());
        Assertions.assertEquals("http://a/b/c/g/", URIUtils.resolve(this.baseURI, "./g/.").toString());
        Assertions.assertEquals("http://a/b/c/g/h", URIUtils.resolve(this.baseURI, "g/./h").toString());
        Assertions.assertEquals("http://a/b/c/h", URIUtils.resolve(this.baseURI, "g/../h").toString());
        Assertions.assertEquals("http://a/b/c/g;x=1/y", URIUtils.resolve(this.baseURI, "g;x=1/./y")
                .toString());
        Assertions.assertEquals("http://a/b/c/y", URIUtils.resolve(this.baseURI, "g;x=1/../y")
                .toString());
        Assertions.assertEquals("http://a/b/c/g?y/./x", URIUtils.resolve(this.baseURI, "g?y/./x")
                .toString());
        Assertions.assertEquals("http://a/b/c/g?y/../x", URIUtils.resolve(this.baseURI, "g?y/../x")
                .toString());
        Assertions.assertEquals("http://a/b/c/g#s/./x", URIUtils.resolve(this.baseURI, "g#s/./x")
                .toString());
        Assertions.assertEquals("http://a/b/c/g#s/../x", URIUtils.resolve(this.baseURI, "g#s/../x")
                .toString());
        Assertions.assertEquals("http:g", URIUtils.resolve(this.baseURI, "http:g").toString());
        // examples from section 5.2.4
        Assertions.assertEquals("http://s/a/b/c/./../../g", URIUtils.resolve(this.baseURI,
                "http://s/a/b/c/./../../g").toString());
        Assertions.assertEquals("http://s/mid/content=5/../6", URIUtils.resolve(this.baseURI,
                "http://s/mid/content=5/../6").toString());
    }
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