### Question:
CompoundClassLoader extends ClassLoader { @Override public Class<?> loadClass(final String name) throws ClassNotFoundException { return this.loadClass(name, false); } CompoundClassLoader(final Collection<ClassLoader> loaders); @Override Class<?> loadClass(final String name); @Override Class<?> loadClass(final String name, final boolean resolve); @Override URL getResource(final String name); @Override Enumeration<URL> getResources(final String name);  }### Answer:
@Test public void shouldresolve() throws ClassNotFoundException { final ClassLoader globalParent = ClassLoaderUtils.getParentClassLoader(); final File[] jarFiles = new File[] { new File("src/test/resources/FooBarPlugin.jar") }; final ClassLoader c1 = ClassLoaderUtils.createClassLoader(jarFiles, globalParent); final File[] classFiles = new File[] { new File("target/test-classes") }; final ClassLoader c2 = ClassLoaderUtils.createClassLoader(classFiles, globalParent); final Collection<ClassLoader> loaders = new ArrayList<>(); loaders.add(c1); loaders.add(c2); final CompoundClassLoader loader = new CompoundClassLoader(loaders); final Class<?> cResult1 = loader.loadClass("foo.bar.transformer.BarTransformer"); Assert.assertNotNull(cResult1); final Class<?> cResult2 = loader.loadClass("foo.bar.Baz"); Assert.assertNotNull(cResult2); }