### Question:
CdiUtilities { @SuppressWarnings("unchecked") public static <T> T getReference(final BeanManager beanManager, final Bean<T> bean, final Type beanType) { return (T) beanManager.getReference(bean, beanType, beanManager.createCreationalContext(bean)); }  @SuppressWarnings("unchecked") static T getReference(final BeanManager beanManager,
            final Bean<T> bean,
            final Type beanType); static T getReference(final BeanManager beanManager, final Class<T> clazz); static final boolean hasAnnotatedMethod(final AnnotatedType<?> at,
            final Class<? extends Annotation> annotationClazz); @SafeVarargs static boolean hasAnnotatedMember(final Bean<?> bean,
            final Class<? extends Annotation>... classes); static BeanManager getBeanManager();  }### Answer:
@Test public void testGetReference() { Set<Bean<?>> beansFound = beanManager.getBeans(Foo.class, new AnnotationLiteral<Default>() { }); assertSame(foo, CdiUtilities.getReference(beanManager, beansFound.iterator().next(), Foo.class)); }