title: How do I bind a Generic class?
body: <p>When I try to mock a Dao using <a href="http://code.google.com/p/jukito/" rel="nofollow">Jukito</a> I get the following exception:</p>
  
  <pre><code>java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
      at org.jukito.JukitoModule.addKeyDependency(JukitoModule.java:338)
      at org.jukito.JukitoModule.addInjectionPointDependencies(JukitoModule.java:330)
      at org.jukito.JukitoModule.addDependencies(JukitoModule.java:313)
  </code></pre>
  
  <p>The object I try to mock is a <code>ConcreteDao</code>.</p>
  
  <pre><code>public class ConcreteDao extends AbstractDao&lt;MyDomain&gt; {
  }
  
  public abstract class AbstractDao&lt;T extends DatastoreObject&gt; {
  }
  </code></pre>
  
  <p>I read several posts on SO about this binding generics but I can't figure out a way to use <code>TypeLiteral</code> for my binding.</p>
  
  <p>This is what I tried:</p>
  
  <pre><code>bind(new TypeLiteral&lt;AbstractDao&lt;MyDomain&gt;&gt;(){}).to(ConcreteDao.class);
  </code></pre>