Object reference1 = getBeanManager().getReference(bean, RequestScopedBean.class, ctx);
Assert.assertNotNull(reference1);
Assert.assertTrue(reference1 instanceof RequestScopedBean);
RequestScopedBean beanInstance1 = (RequestScopedBean)reference1;
TransactionInterceptor.count = 0;
beanInstance1.getMyService().getJ();
RequestScopedBean realInstance1 = beanInstance1.getInstance();
Assert.assertTrue(TransactionInterceptor.ECHO);
Assert.assertEquals(1, TransactionInterceptor.count);
TransactionInterceptor.ECHO = false;
WebBeansContext webBeansContext = WebBeansContext.getInstance();
webBeansContext.getContextFactory().destroyRequestContext(null);
webBeansContext.getContextFactory().initRequestContext(null);
CreationalContext<RequestScopedBean> ctx2 = getBeanManager().createCreationalContext(bean);
Object reference2 = getBeanManager().getReference(bean, RequestScopedBean.class, ctx2);
Assert.assertNotNull(reference2);
Assert.assertTrue(reference2 instanceof RequestScopedBean);
RequestScopedBean beanInstance2 = (RequestScopedBean)reference2;
beanInstance2.getMyService().getJ();
RequestScopedBean realInstance2 = beanInstance2.getInstance();
Assert.assertTrue(TransactionInterceptor.ECHO);
Assert.assertEquals(2, TransactionInterceptor.count);
Assert.assertNotSame(realInstance1, realInstance2);
Assert.assertEquals(realInstance1.getMyService().getJ(), realInstance2.getMyService().getJ());
shutDownContainer();
}