### Question:
URIParserUtil { public static String relativize(String base, String toBeRelativized) throws URISyntaxException { if (base == null || toBeRelativized == null) { return null; } return relativize(new URI(base), new URI(toBeRelativized)); } private  URIParserUtil(); static URL[] pathToURLs(String path); static String escapeChars(String s); static String normalize(final String uri); static String getAbsoluteURI(final String arg); static String relativize(String base, String toBeRelativized); static String relativize(URI baseURI, URI toBeRelativizedURI);  }### Answer:
@Test public void testRelativize() throws URISyntaxException { assertNull(URIParserUtil.relativize(null, "foo")); assertNull(URIParserUtil.relativize("foo", null)); assertEquals("", URIParserUtil.relativize("", "")); assertEquals("", URIParserUtil.relativize("fds", "")); assertEquals("../", URIParserUtil.relativize("fds/", "")); assertEquals("fdsfs", URIParserUtil.relativize("", "fdsfs")); assertEquals("fdsfs/a", URIParserUtil.relativize("", "fdsfs/a")); assertEquals("../de", URIParserUtil.relativize("ab/cd", "de")); assertEquals("../de/fe/gh", URIParserUtil.relativize("ab/cd", "de/fe/gh")); assertEquals("../../../de/fe/gh", URIParserUtil.relativize("/abc/def/", "de/fe/gh")); assertNull(URIParserUtil.relativize("file:/c:/abc/def/", "de/fe/gh")); assertEquals("pippo2.xsd", URIParserUtil.relativize("/abc/def/pippo1.xsd", "/abc/def/pippo2.xsd")); assertEquals("../default/pippo2.xsd", URIParserUtil.relativize("/abc/def/pippo1.xsd", "/abc/default/pippo2.xsd")); assertEquals("def/pippo2.xsd", URIParserUtil.relativize("/abc/def", "/abc/def/pippo2.xsd")); assertEquals("hello_world_schema2.xsd", URIParserUtil.relativize("jar:file:/home/a.jar!/wsdl/others/", "jar:file:/home/a.jar!/wsdl/others/hello_world_schema2.xsd")); }