ExtensionsFactory { public List<Extension> listExtensions() { loadExtensions(); List<Extension> list = new LinkedList<Extension>(); for(Entry<String, Extension> entry : extensions.entrySet()) list.add(entry.getValue()); return list; }  void applicationStarted(@Observes ApplicationBootstrapEvent event); Extension getExtensionByName(String name); List<Extension> listExtensions();  }
@Test public void testListExtensions() { List<Extension> extensions = factory.listExtensions(); Assert.assertEquals(1, extensions.size()); Assert.assertEquals(DummyExtension.class, extensions.get(0).getClass()); }