IsolatedClassloader extends URLClassLoader { @Override public URL getResource(String name) { return findResource(name); } IsolatedClassloader(ClassLoader parent, ClassloadRules rules); @Override URL getResource(String name); @Override Enumeration<URL> getResources(String name);  }
@Test public void dont_get_resource_from_parent() { URL resource2 = classLoader.getParent().getResource("fake.jar"); assertThat(resource2).isNotNull(); URL resource = classLoader.getResource("fake.jar"); assertThat(resource).isNull(); }