CdiUtil { static InjectionManagerStore createHk2InjectionManagerStore() { final InjectionManagerStore manager = lookupService(InjectionManagerStore.class); return manager != null ? manager : new SingleInjectionManagerStore(); } private  CdiUtil(); static Annotation[] getQualifiers(final Annotation[] annotations); static BeanManager getBeanManager(); static Class<? extends Annotation> getBeanScope(final Class<?> beanClass, final BeanManager beanManager);  }
@Test public void createHk2LocatorManagerCustom() throws Exception { assertThat(CdiUtil.createHk2InjectionManagerStore(), instanceOf(TestInjectionManagerStore.class)); }
@Test public void createHk2LocatorManagerDefault() throws Exception { new MockUp<CdiUtil>() { @Mock @SuppressWarnings("UnusedDeclaration") <T> T lookupService(final Class<T> clazz) { return null; } }; assertThat(CdiUtil.createHk2InjectionManagerStore(), instanceOf(SingleInjectionManagerStore.class)); }