### Question:
ResourceUtil { public static URI getAbsoluteResourceURI(URI context, URI resourceName) { return resourceName.isAbsolute() ? resourceName : absoluteURIFor(context, resourceName); }  static URI fromShapefileDir(String shapeFile); static URI fromShapefileDir(URI shapeFile); static InputStream asInputStream(String resource); static InputStream asInputStream(String resource, InputStreamFactory factory); static InputStream asInputStream(URI resource, InputStreamFactory factory); static boolean isFileURI(URI resource); static URI getAbsoluteResourceURI(URI context, URI resourceName); static final String SHAPEFILES_DIR; }### Answer:
@Test public void relativeURI() { URI uri = ResourceUtil.getAbsoluteResourceURI(URI.create("some:/example/"), URI.create("/path")); assertThat(uri.toString(), is("some:/example/path")); }
@Test public void relativeURINoSlash() { URI uri = ResourceUtil.getAbsoluteResourceURI(URI.create("some:/example"), URI.create("path")); assertThat(uri.toString(), is("some:/example/path")); }
@Test public void relativeURISlashContext() { URI uri = ResourceUtil.getAbsoluteResourceURI(URI.create("some:/example/"), URI.create("path")); assertThat(uri.toString(), is("some:/example/path")); }
@Test public void relativeURISlashResource() throws URISyntaxException { URI uri = ResourceUtil.getAbsoluteResourceURI(URI.create("some:/example"), URI.create("/path")); assertThat(uri.toString(), is("some:/example/path")); }