ExtensionsFactory { public Extension getExtensionByName(String name) { loadExtensions(); return extensions.get(name); }  void applicationStarted(@Observes ApplicationBootstrapEvent event); Extension getExtensionByName(String name); List<Extension> listExtensions();  }
@Test public void testGetExtensionByName() { Extension ext; ext = factory.getExtensionByName("dummy"); Assert.assertNotNull(ext); Assert.assertEquals(DummyExtension.class, ext.getClass()); Assert.assertTrue(((DummyExtension)ext).isReadyForService()); Assert.assertNull(factory.getExtensionByName("foo")); }