CdiBeanResolver { InitialContext getInitialContext() throws NamingException { if (null == initialContext) { initialContext = new InitialContext(); } return initialContext; }  T getBean(Class<T> cls);  }
@Test public void testGetInitialContext() throws NamingException { CdiBeanResolver cdiBeanResolver = new CdiBeanResolver(); InitialContext ic = cdiBeanResolver.getInitialContext(); InitialContext ic2 = cdiBeanResolver.getInitialContext(); assertThat(ic).isEqualTo(ic2); }