@Override
    protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
        Class<?> cls = null;
        for (ClassLoader classLoader : classLoaders) {
            try {
                cls = classLoader.loadClass(name);
            } catch (ClassNotFoundException e) {
                LOG.trace("Class " + name + " not found", e);
            }

            if (cls != null) {
                break;
            }
        }

        if (cls == null) {
            throw new ClassNotFoundException("Class " + name + " not found.");
        }

        return cls;
    }
@Test
    public void loadReturnsClassFromParentClassLoader() throws Exception {
        final ClassLoader parent = getClass().getClassLoader();
        final ChainingClassLoader chainingClassLoader = new ChainingClassLoader(parent);
        final String className = "org.graylog2.shared.plugins.ChainingClassLoaderTest$Dummy";
        final Class<?> aClass = chainingClassLoader.loadClass(className);

        assertThat(aClass).isNotNull();
        assertThat(aClass.getSimpleName()).isEqualTo("Dummy");
        assertThat(aClass.getClassLoader()).isSameAs(parent);
    }