@Override
    public Map<String, Set<String>> readPluginsStorages() {
        log.debug("Reading extensions storages from plugins");
        Map<String, Set<String>> result = new LinkedHashMap<>();

        List<PluginWrapper> plugins = pluginManager.getPlugins();
        for (PluginWrapper plugin : plugins) {
            String pluginId = plugin.getPluginId();
            log.debug("Reading extensions storages for plugin '{}'", pluginId);
            final Set<String> bucket = new HashSet<>();

            try {
                Enumeration<URL> urls = findExtensionResource((PluginClassLoader) plugin.getPluginClassLoader());
                if (urls.hasMoreElements()) {
                    collectExtensions(urls, bucket);
                } else {
                    log.debug("Cannot find '{}'", EXTENSIONS_RESOURCE);
                }

                debugExtensions(bucket);

                result.put(pluginId, bucket);
            } catch (IOException | URISyntaxException e) {
                log.error(e.getMessage(), e);
            }
        }

        return result;
    }
@Test
    void readPluginsStorages() {
        String pluginId = "testPlugin";
        PluginWrapper pluginWrapper = mock(PluginWrapper.class);
        when(pluginWrapper.getPluginId()).thenReturn(pluginId);
        when(pluginWrapper.getPluginClassLoader()).thenReturn(null); // not needed for this test

        PluginManager pluginManager = mock(PluginManager.class);
        when(pluginManager.getPlugins()).thenReturn(Collections.singletonList(pluginWrapper));
        ServiceProviderExtensionFinder finder = new ServiceProviderExtensionFinder(pluginManager) {

            @Override
            Enumeration<URL> findExtensionResource(PluginClassLoader classLoader) throws IOException {
                return getExtensionEnumeration();
            }

        };

        Map<String, Set<String>> storages = finder.readPluginsStorages();
        assertNotNull(storages);
        assertTrue(storages.containsKey(pluginId));
        Set<String> extensions = storages.get(pluginId);
        assertEquals(2, extensions.size());
        assertThat(extensions, containsInAnyOrder(HELLO_GREETER_EXTENSION, WELCOME_GREETER_EXTENSION));
    }