title: Getting generic parameter from supertype class
body: <p>Say I have a parent interface/class like so</p>
  
  <pre><code>interface Parent&lt;T&gt; {}
  </code></pre>
  
  <p>And a number of implementing interfaces that fix the generic type.</p>
  
  <pre><code>interface Child extends Parent&lt;Type&gt; {}
  </code></pre>
  
  <p>Can I use reflection to get the instance of <code>Class</code> representing <code>T</code> if I have the <code>Class</code> object for <code>Child</code>. Something like this:</p>
  
  <pre><code>&lt;T, I extends Parent&lt;T&gt;&gt; I create(Class&lt;I&gt; type) {
      Class&lt;T&gt; tType = ...
      ...
  }
  </code></pre>
  
  <p>Currently I'm having <code>tType</code> be passed in as a parameter, but I'd like to simplify things if I can.</p>