title: Resttemplate unable to parse array of type T
body: <p>I'm facing a problem with Spring and restTemplate. I want to send an object (ListResponse) that contains a generic array. The defenition is as follow:</p>
  
  <pre><code>public class ListResponse&lt;T&gt; implements Serializable {
  
  private long total;
  private int page;
  private int pageSize;
  private T[] objects;
  </code></pre>
  
  <p>I send a request whith restTemplate.getForObject(). As a result I get an object of type ListResponse but the objects array contains an array of LinkedHashMaps instead of an array with objects of type T.</p>
  
  <p>It seems like restTemplate can not convert the elements in the array to their correct type.</p>
  
  <p>How can I make sure that I get an array of objects of type T back ?</p>