@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(expected = ClassNotFoundException.class)
    public void loadThrowsClassNotFoundExceptionIfClassDoesNotExist() throws Exception {
        final ChainingClassLoader chainingClassLoader = new ChainingClassLoader(getClass().getClassLoader());
        chainingClassLoader.loadClass("ThisClassHopeFullyDoesNotExist" + Instant.now().toEpochMilli());
    }