@Test
public void createPaginatedResponseWithJsonTest() {

    JSONArray array = JSONArray.fromObject("[{'@graph':[" + expectedTypedJsonld + "]}]");
    Response response = RestUtils.createPaginatedResponseWithJson(uriInfo, array, 3, 1, 0);
    assertEquals(response.getLinks().size(), 1);
    Link link = response.getLinks().iterator().next();
    assertEquals(link.getRel(), "next");
    assertTrue(link.getUri().getRawPath().equals("/rest/tests"));
    response = RestUtils.createPaginatedResponseWithJson(uriInfo, array, 3, 1, 1);
    assertEquals(response.getLinks().size(), 2);
    assertTrue(response.getLinks().stream()
            .allMatch(lnk -> (lnk.getRel().equals("prev") || lnk.getRel().equals("next"))
                    && lnk.getUri().getRawPath().equals("/rest/tests")));
    response = RestUtils.createPaginatedResponseWithJson(uriInfo, array, 3, 1, 2);
    assertEquals(response.getLinks().size(), 1);
    link = response.getLinks().iterator().next();
    assertEquals(link.getRel(), "prev");
    assertTrue(link.getUri().getRawPath().equals("/rest/tests"));
    response = RestUtils.createPaginatedResponseWithJson(uriInfo, array, 3, 3, 0);
    assertEquals(response.getLinks().size(), 0);
}