title: Issue with type parameter: "cannot select from parameterized type"
body: <p>I am facing an issue with generics.</p>
  
  <p>Here is one of my classes that uses generics:</p>
  
  <pre><code>public class TokenServerResponse&lt;D&gt; {
  
      private String responseCode;
      private String responseMessage;
      private D responseData;
      ....
  </code></pre>
  
  <p>Here our class: <code>TokenServerResponse</code> is parameterized with <code>D</code>.</p>
  
  <p>I would like to specify the type in one of our methods as follows:</p>
  
  <pre><code>   protected ResponseEntity&lt;TokenServerResponse&lt;DigestResponseData&gt;&gt; digest(long globalMerchantUId, String expirydate, String pan, boolean updateExpiryDate) throws Exception {
          DigestRequest digestRequest = new DigestRequest();
          digestRequest.setGlobalMerchantUid(globalMerchantUId);
          digestRequest.setExpiryDate(expirydate);
          digestRequest.setPan(pan);
          digestRequest.setUpdateExpiryDate(updateExpiryDate);
          return restTemplate.postForEntity("/digest", digestRequest, TokenServerResponse&lt;DigestResponseData&gt;.class);
      }
  </code></pre>
  
  <p>However, I get the following compiler error: <code>cannot select from parameterized type</code>.</p>
  
  <p>How can I use the type parameter <code>D</code>? I have also tried casting to no avail. What am I getting wrong?</p>
  
  <p>Here is how the <code>digest</code> method is called: </p>
  
  <pre><code>    ResponseEntity&lt;TokenServerResponse&lt;DigestResponseData&gt;&gt; digestResponseEntity = digest(823, "1505", pan, true);
  </code></pre>