@Test
public void testFindFromPlugin() {

    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");
            bucket.add("org.pf4j.plugin.FailTestExtension");
            entries.put("plugin1", bucket);
            bucket = new HashSet<>();
            bucket.add("org.pf4j.plugin.TestExtension");
            entries.put("plugin2", bucket);
            return entries;
        }
        @Override
        public Map<String, Set<String>> readClasspathStorages() {
            return Collections.emptyMap();
        }
    };
    List<ExtensionWrapper<TestExtensionPoint>> list = instance.find(TestExtensionPoint.class);
    assertEquals(2, list.size());
    list = instance.find(TestExtensionPoint.class, "plugin1");
    assertEquals(2, list.size());
    list = instance.find(TestExtensionPoint.class, "plugin2");
    assertEquals(0, list.size());
}