### Question:
FilePathToURITransformer implements Transformer<String, URI> { @Override public URI transform(final String location) throws TransformationException { if (location == null) { throw new IllegalArgumentException("Location must not be null."); } return new File(location).toURI(); }  @Override URI transform(final String location);  }### Answer:
@Test(expectedExceptions=IllegalArgumentException.class) public void testTransformationIfNullLocation() throws Exception { transformer.transform(null); }
@Test public void testTransformation() throws Exception { final URL url = getClass().getResource("/empty.xsd"); final String location = FileUtils.toFile(url).getAbsolutePath(); final URI uri = transformer.transform(location); assertNotNull("Result URI is null.", uri); assertEquals("Unexpected URI.", url.toURI(), uri); }