### Question:
IsolatedClassRealm extends URLClassLoader { @Override public Enumeration<URL> getResources( String name ) throws IOException { Collection<URL> resources = new LinkedHashSet<>(); if ( isImported( name ) ) { try { resources.addAll( Collections.list( parent.getResources( name ) ) ); } catch ( IOException e ) { } } try { resources.addAll( Collections.list( super.getResources( name ) ) ); } catch ( IOException e ) { } try { resources.addAll( Collections.list( super.findResources( name ) ) ); } catch ( IOException e ) { } return Collections.enumeration( resources ); } IsolatedClassRealm( ClassLoader parent ); void addJar( Path jar ); void addJarDirectory( Path dir ); void importPackage( String packageName ); void importAllPackages( String packageName ); @Override Class<?> loadClass( String name ); @Override URL getResource( String name ); @Override Enumeration<URL> getResources( String name );  }### Answer:
@Test public void testGetResources() throws Exception { try (IsolatedClassRealm realm = new IsolatedClassRealm( IsolatedClassRealmTest.class.getClassLoader() )) { realm.addJarDirectory( resourceDir ); realm.getResource( "secret-file" ); Enumeration<URL> resources = realm.getResources( "secret-file" ); assertTrue( resources.hasMoreElements() ); resources.nextElement(); assertTrue( resources.hasMoreElements() ); } }