title: Cannot access class methods via generics
body: <p>I changed my method to <a href="https://stackoverflow.com/questions/27413112/passing-and-using-class-in-a-method-in-java">generic</a> method. What is happening now is that I was deserializing the class inside the <code>methodB</code> and accessing its methods which I can not do anymore.</p>
  
  <pre><code>&lt;T&gt; void methodB(Class&lt;T&gt; clazz) {
      T var;
      HashMap&lt;String, T&gt; hash = new HashMap&lt;&gt;();
  }
  
  void methodA () {
    methodB(classA.class);
  }
  </code></pre>
  
  <p>Initially inside <code>methodB</code> with no generics,</p>
  
  <pre><code>var = mapper.convertValue(iter.next(), ClassA.class);
  var.blah() //works fine
  </code></pre>
  
  <p>After using generics,</p>
  
  <pre><code>var = mapper.convertValue(iter.next(), clazz);
  var.blah() //cannot resolve the method.
  </code></pre>
  
  <p>How do I access <code>blah()</code> method of <code>classA</code>? </p>