public void testPreDestroyCalled() {
ObjectFactory of = factoryRegistry.getObjectFactory(ProviderPreDestroySingleton.class);
assertEquals(JSR250SingletonObjectFactory.class, of.getClass());
// no PostConstruct in ProviderPreDestroySingleton
assertEquals(called, null);
RuntimeContext context = RuntimeContextTLS.getRuntimeContext();
of.releaseInstance(of.getInstance(context), context);
assertEquals(called, null); // we don't want releaseInstance to call @PreDestroy annotated method for singletons
of.releaseAll(context);
assertEquals(called, ProviderPreDestroySingleton.class.getSimpleName() + ".preDestroy()");
}