code: public static <T> Releasable<T> inject(final Class<T> clazz) {
          try {
              final BeanManager beanManager = CDI.current().getBeanManager();
              if (beanManager == null) {
                  return null;
              }
              final AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(clazz);
              final InjectionTarget<T> it = beanManager.createInjectionTarget(annotatedType);
              final CreationalContext<T> context = beanManager.createCreationalContext(null);
              final T instance = it.produce(context);
              it.inject(instance, context);
              it.postConstruct(instance);
  
              return new Releasable<T>(context, it, instance);
          } catch (final Exception e) {
              // no-op
          } catch (final NoClassDefFoundError error) {
              // no-op
          }
          return null;
      }
docs: Request that an instance of the specified type be provided by the container.
  
  @param clazz
  @return the requested instance wrapped in a {@link Releasable}.