Uri { public static String resolve(String base, String uriReference) { if (!isAbsolute(uriReference) && base != null && isAbsolute(base)) { try { URI baseURI = new URI(UriEncoder.encode(base)); return baseURI.resolve(new URI(UriEncoder.encode(uriReference))).toString(); } catch (URISyntaxException e) { } } return uriReference; }  static boolean isValid(String s); static String escapeDisallowedChars(String s); static String resolve(String base, String uriReference); static boolean hasFragmentId(String uri); static boolean isAbsolute(String uri);  }
@Test(dataProvider = "resolve") public void testResolve(String base, String ref, String result) { Assert.assertEquals(Uri.resolve(base, ref), result); }