@Test
public void testFindClassNames() {

    ExtensionFinder instance = new AbstractExtensionFinder(pluginManager) {
        @Override
        public Map<String, Set<String>> readPluginsStorages() {
            Map<String, Set<String>> entries = new LinkedHashMap<>();
            Set<String> bucket = new HashSet<>();
            bucket.add("org.pf4j.plugin.TestExtension");
            entries.put("plugin1", bucket);
            return entries;
        }
        @Override
        public Map<String, Set<String>> readClasspathStorages() {
            Map<String, Set<String>> entries = new LinkedHashMap<>();
            Set<String> bucket = new HashSet<>();
            bucket.add("org.pf4j.plugin.TestExtension");
            bucket.add("org.pf4j.plugin.FailTestExtension");
            entries.put(null, bucket);
            return entries;
        }
    };
    Set<String> result = instance.findClassNames(null);
    assertEquals(2, result.size());
    result = instance.findClassNames("plugin1");
    assertEquals(1, result.size());
}