final BeanManagerImpl bm = findBeanManager(ctx);
if (bm != null && bm.isInUse()) {
try {
final Set<Bean<?>> beans = bm.getBeans(testInstance.getClass());
final Bean<?> bean = bm.resolve(beans);
final CreationalContext<?> cc = bm.createCreationalContext(bean);
if (context != null) {
context.set(CreationalContext.class, cc);
}
OWBInjector.inject(bm, testInstance, cc);