title: ClassCastException: RestTemplate returning List<LinkedHashMap> instead of List<MymodelClass>
body: <p>I'm trying to access getter methods on my MyModelClass but my code is returning <code>List&lt;LinkedHashMap&gt;</code> instead of <code>List&lt;MyModelClass&gt;</code>. This is my code.</p>
  
  <pre><code>List&lt;MyModelClass&gt; myModelClass=(List&lt;MyModelClass&gt;) restTemplate.postForObject(url,mvm,List.class);
  
  System.out.println("Response= " +  myModelClass);
  </code></pre>
  
  <p>I tried to print the response and I got the JSON Response that I'm expecting. 
  but when I tried to run this code.</p>
  
  <pre><code>System.out.println("Response= " +  myModelClass.get(0).getMessage());
  </code></pre>
  
  <p>It will produce this error.</p>
  
  <pre><code>java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.XXX.XXX.MyModelClass 
  </code></pre>
  
  <p>It is a mismatch. Can someone help me to get rid with this error? thanks.</p>
  
  <p>MyModelClass</p>
  
  <pre><code>public class MyModelClass{
  
      /**
       * 
       */
      @JsonProperty("id")
      public String id;
  
      @JsonProperty("type")
      public String type;
  
      @JsonProperty("user")
      public String user;
  
      @JsonProperty("message")
      public String message;
  
      //getters
  </code></pre>
  
  <p>Error for </p>
  
  <pre><code>MyModelClass[] myModelClass= restTemplate.postForObject(url,mvm, myModelClass[].class);
  </code></pre>
  
  <p>org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token</p>
  
  <p>JSON Response Structure</p>
  
  <pre><code>    [{"key1":"value1","key2":"value2","parameters":{"key1":"value1","key2":"value2","key3":"value3","key4":"value4","key5":"value5"}},
  {"key12":"value12","key22":"value22","parameters":{"key12":"value12","key22":"value22","key32":"value32","key42":"value42","key52":"value52"}}]
  </code></pre>
  
  <p>If there is any suggestion on how to map this kind of JSON Response in RestTemplate,It would help a lot. thanks</p>