Code example for URI

Methods: getFragmentgetPort

        assertEquals(null, uri.getQuery());
        assertEquals("fragment?query", uri.getFragment());
    public void testColonInFragment() throws Exception { 
        URI uri = new URI("http://host/file#fragment:80");
        assertEquals("/file", uri.getPath());
        assertEquals(-1, uri.getPort());
        assertEquals("fragment:80", uri.getFragment());
    public void testSlashInFragment() throws Exception { 
        URI uri = new URI("http://host/file#fragment/path");
        assertEquals("/file", uri.getPath());
        assertEquals("fragment/path", uri.getFragment());
    public void testHashInFragment() throws Exception { 
        try { 
            // This is not consistent with 
Experience pair programming with AI  Get Codota for Java