title: CDI: get manually instance of bean of class which is declared with generics
body: <p>This is the way how I get manually instance of cdi bean:</p>
  
  <pre><code>Bean&lt;?&gt; bean = (Bean&lt;?&gt;)beanManager.resolve(beanManager.getBeans(Foo.class));
  Foo foo=(Foo) beanManager.getReference(bean, bean.getBeanClass(), beanManager.createCreationalContext(bean));
  </code></pre>
  
  <p>if I declare Foo class this way:</p>
  
  <pre><code>@Dependent
  public class Foo{
     ...
  }
  </code></pre>
  
  <p>everything works. However, if I declare class Foo this way</p>
  
  <pre><code>@Dependent
  public class Foo&lt;T&gt;{
     ...
  }
  </code></pre>
  
  <p>cdi container can't create cdi bean. How can I get manually cdi bean of class declared with generics (Foo)?</p>