@Test
public void testHierarchicalUri() throws Exception {

    final URI uri = new URI("http", "stuff", "localhost", 80, "/some stuff", "param=stuff", "fragment");
    final URIBuilder uribuilder = new URIBuilder(uri);
    final URI result = uribuilder.build();
    Assert.assertEquals(new URI("http://stuff@localhost:80/some%20stuff?param=stuff#fragment"), result);
}