title: new Java Generic class constructor issue when templete class nested
body: <p>All</p>
  
  <p>I have below define :</p>
  
  <p><strong>JsonResponse.class</strong> as below:</p>
  
  <pre><code>public abstract class JsonResponse&lt;T&gt; extends AbstractResponse {
  private T jsonObject;
  
  public JsonResponse(HttpResponse httpResponse, Class&lt;T&gt; classT) {
      super(httpResponse);
      jsonObject = new Gson().fromJson(
              ResponseUtils.getStringContent(getHttpResponse()), classT);
  }
  
  public T getJsonObject() {
      return jsonObject;
  }
  
  }
  </code></pre>
  
  <p>But below class i want to new and return as: </p>
  
  <pre><code>return new JsonResponse&lt;T&gt;(response, classT);
  </code></pre>
  
  <p>but I can't compile it with error, would you please take a look at it . Thank you .</p>
  
  <pre><code>public class JsonResponseHandler&lt;T&gt; implements ResponseHandler&lt;JsonResponse&lt;T&gt;&gt; {
  
  private Class&lt;T&gt; classT;
  
  public JsonResponseHandler(Class&lt;T&gt; classT) {
      this.classT = classT;
  
  }
  
  @Override
  public JsonResponse&lt;T&gt; handleResponse(HttpResponse response)
          throws ClientProtocolException, IOException {
  
      return new  JsonResponse&lt;T&gt;(response, classT) ; //compile  always error
  }
  
  }
  </code></pre>