Spring: RestTemplate returns null object
<p>With the below GET request:</p>

<pre><code>ResponseEntity&lt;String&gt; entity = restTemplate.exchange(uri, HttpMethod.GET, requestEntity, String.class );
entity.getBody();
</code></pre>

<p>returns a JSON String like this: </p>

<pre><code>{"userRegistrations":[{"userRegistrationToken":"fb398972","userRegistrationTokenAlias":"87f15f8"}]}
</code></pre>

<p>But I want to make this work with an object not with a string. So with the code below I receive a UserRegistrations object with a null UserTokenResponse List</p>

<pre><code>ResponseEntity&lt;UserRegistrations&gt; entity = restTemplate.exchange(uri, HttpMethod.GET, requestEntity, UserRegistrations.class );
entity.getBody();
</code></pre>

<p>And my domain class looks like this:</p>

<pre><code>public class UserRegistrations {
    List&lt;UserTokenResponse&gt; userRegistrationList;
    //..getters and setters
}

public class UserTokenResponse {
   private String userRegistrationToken;
   private String userRegistrationTokenAlias;
   //getters and setters
}
</code></pre>

<p>What am I missing?</p>