title: Generic method, equality constraint
body: <p>Hello Im trying to implement a generic method as controller base method, but the problem which I cannot understand happens with the generic method signature.</p>
  
  <pre><code>&lt;T&gt; ResponseEntity&lt;T&gt; makeApiCall(String path, HttpMethod httpMethod, T body, boolean isAdmin){
  
          String sender = isAdmin ? adminHash : userHash;
          HttpHeaders headers = new HttpHeaders();
          headers.add("Authorization", sender);
          headers.add("Content-Type", "application/json");
          HttpEntity&lt;T&gt; entity = new HttpEntity&lt;&gt;(body,headers);
          ResponseEntity&lt;T&gt; responseEntity = restTemplate.exchange(path, HttpMethod.POST, entity, body.getClass());
          return responseEntity;
  }
  </code></pre>
  
  <p>The compile error I currently have is as follows:</p>
  
  <pre><code>Incompatible equality constraint: T and capture of ? extends Object
  </code></pre>