### Question:
MultipleParentClassLoader extends InjectionClassLoader { public URL getResource(String name) { for (ClassLoader parent : parents) { URL url = parent.getResource(name); if (url != null) { return url; } } return super.getResource(name); } 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 testMultipleParentURL() throws Exception { ClassLoader classLoader = new MultipleParentClassLoader.Builder().append(first, second, null).build(); assertThat(classLoader.getResource(FOO), is(fooUrl)); assertThat(classLoader.getResource(BAR), is(barFirstUrl)); assertThat(classLoader.getResource(QUX), is(quxUrl)); verify(first).getResource(FOO); verify(first).getResource(BAR); verify(first).getResource(QUX); verifyNoMoreInteractions(first); verify(second).getResource(QUX); verifyNoMoreInteractions(second); }
@Test public void testMultipleParentURLNotFound() throws Exception { assertThat(new MultipleParentClassLoader.Builder().append(first, second, null).build().getResource(BAZ), nullValue(URL.class)); }