URLLocator implements Locator<URLLocation> { @Override public InputStream openInputStream(URLLocation location) { try { return location.getURL().openStream(); } catch (IOException e) { throw new IllegalStateException("Fail to open " + location, e); } }  @Override File locate(URLLocation location); @Override File copyToDirectory(URLLocation location, File toDir); @Override InputStream openInputStream(URLLocation location); @Override File copyToFile(URLLocation location, File toFile);  }
@Test public void openInputStream() throws Exception { InputStream input = underTest.openInputStream(location); assertThat(IOUtils.toString(input)).isEqualTo("foo"); }