@Override
    public Enumeration<URL> getResources(String name) throws IOException {
        List<URL> allRes = new LinkedList<>();

        // load resource from this classloader
        Enumeration<URL> thisRes = findResources(name);
        if (thisRes != null) {
            while (thisRes.hasMoreElements()) {
                allRes.add(thisRes.nextElement());
            }
        }

        // then try finding resources from parent classloaders
        Enumeration<URL> parentRes = super.findResources(name);
        if (parentRes != null) {
            while (parentRes.hasMoreElements()) {
                allRes.add(parentRes.nextElement());
            }
        }

        return new Enumeration<>() {
            final Iterator<URL> it = allRes.iterator();

            @Override
            public boolean hasMoreElements() {
                return it.hasNext();
            }

            @Override
            public URL nextElement() {
                return it.next();
            }
        };
    }
@Test
    public void shouldReturnResourcesFromAllClassloaders() throws Exception {
        cl = new ChildFirstClassLoader(new URL[]{jarUrl},
                ChildFirstClassLoader.class.getClassLoader());

        Enumeration<URL> urlsEnum = cl.getResources("childfirstclassloader/resource_test.txt");
        List<String> urls = new ArrayList<>();
        while (urlsEnum.hasMoreElements()) {
            urls.add(urlsEnum.nextElement().toString());
        }

        assertThat(urls).hasSize(2);
    }