### Question:
Classpaths { public static List<URL> classpathResources( ClassLoader loader, String resource ) { try { Enumeration<URL> resources = loader.getResources( resource ); List<URL> list = list( resources ); if ( isEmpty( list ) && resource.startsWith( "/" ) ) { resource = resource.substring( 1 ); return classpathResources( loader, resource ); } return list; } catch ( Exception ex ) { return Exceptions.handle( List.class, sputs( "Unable to load listFromClassLoader for", resource ), ex ); } }  static List<URL> classpathResources( ClassLoader loader, String resource ); static List<URL> classpathResources( Class<?> clazz, String resource ); static List<String> resources( Class<?> clazz, String resource ); static List<Path> paths( Class<?> clazz, String resource ); static List<String> listFromClassLoader(ClassLoader loader, String resource); static List<Path> pathsFromClassLoader(ClassLoader loader, String resource);  }### Answer:
@Test public void test() throws Exception { final List<URL> urls = Classpaths.classpathResources( this.getClass(), "testfile.txt" ); URL url = urls.get( 0 ); boolean ok = true; ok |= Str.in( "apple", IO.read( url.openStream() ) ) || die(); }
@Test public void test1() throws Exception { final List<URL> urls = Classpaths.classpathResources( this.getClass(), "org/node/file1.txt" ); URL url = urls.get( 0 ); boolean ok = true; ok |= Str.in( "abc", IO.read( url.openStream() ) ) || die(); }
@Test public void test2() throws Exception { final List<URL> urls = Classpaths.classpathResources( this.getClass(), "/org/node/file1.txt" ); URL url = urls.get( 0 ); boolean ok = true; ok |= Str.in( "abc", IO.read( url.openStream() ) ) || die(); }
@Test public void test2NoRoot() throws Exception { final List<URL> urls = Classpaths.classpathResources( this.getClass(), "org/node/file1.txt" ); URL url = urls.get( 0 ); boolean ok = true; ok |= Str.in( "abc", IO.read( url.openStream() ) ) || die(); }