### Question:
IRODSUriUtils { public static URI buildURI(final String host, final int port, final IRODSUriUserInfo userInfo, final String absPath) { try { final URI base = buildBaseURI(host, port, userInfo); return base.resolve(new URI(null, absPath, null)); } catch (final URISyntaxException e) { throw new JargonRuntimeException(e); } }  static IRODSUriUserInfo getUserInfo(final URI irodsURI); static String getUserName(final URI irodsURI); static String getZone(final URI irodsURI); static String getPassword(final URI irodsURI); static String getHostFromURI(final URI uri); static int getPortFromURI(final URI uri); static String getAbsolutePathFromURI(final URI uri); static IRODSAccount getIRODSAccountFromURI(final URI irodsURI); static boolean isIRODSURIScheme(final URI irodsURI); static URI buildBaseURI(final String host, final int port, final IRODSUriUserInfo userInfo); static URI buildBaseURI(final String host, final int port, final String username); static URI buildURI(final String host, final int port, final IRODSUriUserInfo userInfo,
			final String absPath); static URI buildURI(final String host, final int port, final String username, final String absPath); static URI buildAnonymousURI(final String host, final int port, final String absPath); static URI buildURIForAnAccountAndPath(final IRODSAccount irodsAccount, final String irodsPath); static URI buildURIForAnAccountWithNoUserInformationIncluded(final IRODSAccount irodsAccount,
			final String irodsPath);  }### Answer:
@Test public void testBuildURIUserName() throws Exception { final URI expectedURI = new URI("irods: final URI actualURI = buildURI("host.domain", 10000, "user", "/path/to/entity"); assertEquals(expectedURI, actualURI); }
@Test public void testBuildURIUserInfo() throws Exception { final URI expectedURI = new URI("irods: final IRODSUriUserInfo info = IRODSUriUserInfo.instance("user", "zone", "password"); final URI actualURI = buildURI("host.domain", 10000, info, "/path/to/entity"); assertEquals(expectedURI, actualURI); }
@Test public void testEcoding() throws Exception { final URI expectedURI = new URI("irods: final URI actualURI = buildURI("host.domain", 10000, "us[er", "/path/t o/entity{"); assertEquals(expectedURI, actualURI); }