@Override
    public URL getResource(final String name) {
        try {
            final Enumeration<URL> resources = getResources(name);
            if (resources.hasMoreElements()) {
                return resources.nextElement();
            }
        } catch (IOException ignored) {
            // mimics the behavior of the JDK
        }
        return null;
    }
@Test
    void testOwnerFirstResourceFoundIgnoresComponent() throws IOException {
        String resourceToLoad =
                TempDirUtils.newFile(tempFolder, "tmpfile" + UUID.randomUUID()).getName();
        TestUrlClassLoader owner =
                new TestUrlClassLoader(resourceToLoad, RESOURCE_RETURNED_BY_OWNER);

        final ComponentClassLoader componentClassLoader =
                new ComponentClassLoader(
                        new URL[] {},
                        owner,
                        new String[] {resourceToLoad},
                        new String[0],
                        Collections.emptyMap());

        final URL loadedResource = componentClassLoader.getResource(resourceToLoad);
        assertThat(loadedResource).isSameAs(RESOURCE_RETURNED_BY_OWNER);
    }