title: How to consume Page<Entity> response using Spring RestTemplate
body: <p>I'm using spring data (mongoDb) and I've got my repository:</p>
  
  <pre><code>public interface StoriesRepository extends PagingAndSortingRepository&lt;Story, String&gt; {}
  </code></pre>
  
  <p>Then i have a controller:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET)
  public ResponseEntity&lt;Page&lt;StoryResponse&gt;&gt; getStories(Pageable pageable) {
      Page&lt;StoryResponse&gt; stories = storiesRepository.findAll(pageable).map(StoryResponseMapper::toStoryResponse);
      return ResponseEntity.ok(stories);
  }
  </code></pre>
  
  <p>Everything works fine, but I can't consume my endpoint using RestTemplate getForEntity method:</p>
  
  <pre><code>def entity = restTemplate.getForEntity(getLocalhost("/story"), new TypeReference&lt;Page&lt;StoryResponse&gt;&gt;(){}.class)
  </code></pre>
  
  <p>What class should I provide to successfully deserialize my Page of entities?</p>