DefaultExtensionFactory implements ExtensionFactory { @Override public <T> T create(Class<T> extensionClass) { log.debug("Create instance for extension '{}'", extensionClass.getName()); try { return extensionClass.newInstance(); } catch (Exception e) { throw new PluginRuntimeException(e); } }  @Override T create(Class<T> extensionClass);  }
@Test public void testCreate() { assertNotNull(extensionFactory.create(TestExtension.class)); }
@Test public void testCreateFailConstructor() { assertThrows(PluginRuntimeException.class, () -> extensionFactory.create(FailTestExtension.class)); }