@Test
public void testCollectionResponse() throws IOException {

  MockHttpServletResponse servletResponse = new MockHttpServletResponse();
  ServletResponseResultWriter writer = new ServletResponseResultWriter(servletResponse, null);
  writer.write(getBeans(2));
  ObjectNode json = new ObjectMapper().readValue(
      servletResponse.getContentAsString(), ObjectNode.class);
  assertThat(json.path("items")).hasSize(2);
  assertThat(json.path("nextPageToken").asText()).isEqualTo("next");
}