### Question:
MultipleParentClassLoader extends InjectionClassLoader { public Enumeration<URL> getResources(String name) throws IOException { List<Enumeration<URL>> enumerations = new ArrayList<Enumeration<URL>>(parents.size() + 1); for (ClassLoader parent : parents) { enumerations.add(parent.getResources(name)); } enumerations.add(super.getResources(name)); return new CompoundEnumeration(enumerations); } MultipleParentClassLoader(List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents, boolean sealed); URL getResource(String name); Enumeration<URL> getResources(String name);  }### Answer:
@Test @IntegrationRule.Enforce public void testMultipleParentEnumerationURL() throws Exception { ClassLoader classLoader = new MultipleParentClassLoader.Builder().append(first, second, null).build(); Enumeration<URL> foo = classLoader.getResources(FOO); assertThat(foo.hasMoreElements(), is(true)); assertThat(foo.nextElement(), is(fooUrl)); assertThat(foo.hasMoreElements(), is(false)); Enumeration<URL> bar = classLoader.getResources(BAR); assertThat(bar.hasMoreElements(), is(true)); assertThat(bar.nextElement(), is(barFirstUrl)); assertThat(bar.hasMoreElements(), is(true)); assertThat(bar.nextElement(), is(barSecondUrl)); assertThat(bar.hasMoreElements(), is(false)); Enumeration<URL> qux = classLoader.getResources(QUX); assertThat(qux.hasMoreElements(), is(true)); assertThat(qux.nextElement(), is(quxUrl)); assertThat(qux.hasMoreElements(), is(false)); }
@Test(expected = NoSuchElementException.class) public void testMultipleParentEnumerationNotFound() throws Exception { ClassLoader classLoader = new MultipleParentClassLoader.Builder().append(first, second, null).build(); Enumeration<URL> enumeration = classLoader.getResources(BAZ); assertThat(enumeration.hasMoreElements(), is(false)); enumeration.nextElement(); }