title: Passing a class and calling a method on it
body: <p>Consider a class extending <code>Fragment</code> called <code>MyFragmentClass</code> which has <code>newInstance(args)</code> implemented.</p>
  
  <p>What I want to do is make a getter for anything extending <code>MyFragmentClass</code> so I can make a new Fragment via <code>newInstance(args)</code>. Something like:</p>
  
  <pre><code>&lt;T extends MyFragmentClass&gt; Class&lt;T&gt; getMyFragmentClass() {
      return SomeClassExtendingMyFragmentClass.class;
  }
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>public void makeNewFragment() {
      MyFragmentClass fragment = getMyFragmentClass().somehowCallNewInstance(args);
  }
  </code></pre>
  
  <p>However I am having some difficulty, since I can't really pass it a <code>new MyFragmentClass()</code> as this defeats the purpose of using <code>newInstance(args)</code>, and I can't call <code>newInstance(args)</code> early if the args I want are in the class invoking the <code>get()</code> call.</p>
  
  <p>I tried passing back the <code>.class</code> but I was only able to call <code>newInstance()</code> on it (no args).</p>
  
  <p>Is there a workaround?</p>