title: How to do `MyClass<String>.class` in Java?
body: <p>How can call <code>public &lt;T&gt; T doit(Class&lt;T&gt; clazz);</code> using <code>MyClass&lt;String&gt;.class</code> as clazz where I can not instantiate or extend MyClass.</p>
  
  <p>EDIT: 'David Winslow' and 'bmargulies' responses are correct <code>(MyClass&lt;String&gt;) doit(MyClass.class);</code> works for the original question BUT surprisingly when the method returns say <code>MyClass&lt;T&gt;</code> instead of <code>T</code> casting will not compile any more.</p>
  
  <p>Edit: I have replaced List with MyClass and added the condition to my original question.</p>