ClassPathLoader { public InputStream getResourceAsStream(final String name) { URL url = getResource(name); try { return url != null ? url.openStream() : null; } catch (IOException e) { return null; } } ClassPathLoader(boolean excludeTCCL);  ClassPathLoader(boolean excludeTCCL, File workingDir); static ClassPathLoader setLatestToDefault(File workingDir); JarDeployer getJarDeployer(); URL getResource(final String name); Class<?> forName(final String name); @Override String toString(); URL getResource(final Class<?> contextClass, final String name); InputStream getResourceAsStream(final String name); InputStream getResourceAsStream(final Class<?> contextClass, final String name); Enumeration<URL> getResources(final String name); ClassLoader asClassLoader(); static ClassPathLoader getLatest(); static ClassLoader getLatestAsClassLoader();  }
@Test public void testGetResourceAsStream() throws Exception { System.out.println("\nStarting ClassPathLoaderTest#testGetResourceAsStream"); String resourceToGet = "org/apache/geode/internal/classpathloaderjunittest/DoesExist.class"; InputStream is = ClassPathLoader.getLatest().getResourceAsStream(resourceToGet); assertThat(is).isNotNull(); int totalBytesRead = 0; byte[] input = new byte[256]; BufferedInputStream bis = new BufferedInputStream(is); for (int bytesRead = bis.read(input); bytesRead > -1;) { totalBytesRead += bytesRead; bytesRead = bis.read(input); } bis.close(); assertThat(totalBytesRead).isEqualTo(GENERATED_CLASS_BYTES_COUNT); }