PluginManager { public List<T> getPlugins() { return plugins; } private  PluginManager(Class<T> pluginClass, List<T> plugins); T getProxy(); I getProxy(Class<I> proxyInterface); List<T> getPlugins(); static Builder<T> builder(Class<T> pluginClass);  }
@Test public void testBuilderWithPluginsFromClassLoaderAndFilter() throws CircularDependencyException, InstantiationException, IllegalAccessException, ClassNotFoundException { PluginManager<TestPluginInterface2> pluginManager = new PluginManager.Builder<TestPluginInterface2>(TestPluginInterface2.class).withPluginsFromClasspath() .withPluginFilter(p->false).build(); Assert.assertEquals(0, pluginManager.getPlugins().size()); }