code: public static <T> Collection<T> getAllBeansOfType(WeldContainer weldContainer, Class<T> type) {
      Collection<T> beans = Lists.newArrayList();
      Set<Bean<?>> cdiBeans = weldContainer.getBeanManager().getBeans(type, AnyLiteral.INSTANCE);
      // searches all beans for beans that have the matching goal name, ...
      for (Bean<?> b : cdiBeans) {
        @SuppressWarnings("unchecked")
        Bean<T> b2 = (Bean<T>) b;
        CreationalContext<T> creationalContext = weldContainer.getBeanManager().createCreationalContext(b2);
        T bean = b2.create(creationalContext);
        beans.add(bean);
      }
      return beans;
    }
docs: Searches the container for all beans of a certain type without respecting qualifiers.
  
  @param weldContainer the container providing the beans.
  @param type the type of the beans to search for.
  @return a collection of all found beans of the specified type.