title: Getting the class of a Java generic, and interface implementation of generics
body: <p>I'd like to make a class that looks basically like this:</p>
  
  <pre><code>public class MyClass&lt;T implements Serializable) {
  
     void function() {
        Class c = T.class;
     }
  }
  </code></pre>
  
  <p>Two errors:<br/>
  - I cannot call T.class, even though I can do that with any other object type<br/>
  - I cannot enforce that T implements Serializable in this way</p>
  
  <p>How do I solve my two generics problems?</p>
  
  <p>Cheers</p>
  
  <p>Nik</p>