### Question:
AlternativeDirectoryResourceLoader implements AlternativeResourceLoader { public InputStream getResourceAsStream(String name) { URL url = getResource(name); if (url != null) { try { return url.openStream(); } catch (IOException e) { log.error("Unable to open URL " + url, e); } } return null; } AlternativeDirectoryResourceLoader(); URL getResource(String path); InputStream getResourceAsStream(String name); List<File> getResourceDirectories(); static final String PLUGIN_RESOURCE_DIRECTORIES; }### Answer:
@Test public void testGetResourceAsStream() throws MalformedURLException { InputStream in = null; try { System.setProperty(AlternativeDirectoryResourceLoader.PLUGIN_RESOURCE_DIRECTORIES, base.getAbsolutePath()); AlternativeResourceLoader loader = new AlternativeDirectoryResourceLoader(); in = loader.getResourceAsStream("kid.txt"); assertNotNull(in); assertNull(loader.getResource("asdfasdfasf")); } finally { System.getProperties().remove(AlternativeDirectoryResourceLoader.PLUGIN_RESOURCE_DIRECTORIES); IOUtils.closeQuietly(in); } }