Page { public static <T> Page<T> of(Collection<T> items) { return new Page<>(new HashMap<>(), items); } private  Page(
		Map<String, Map<String, String>> actions, Collection<T> items); private  Page(
		Map<String, Map<String, String>> actions, List<Facet> facets,
		Collection<T> items, Pagination pagination, long totalCount); static Page<T> of(Collection<T> items); static Page<T> of(
		Collection<T> items, Pagination pagination, long totalCount); static Page<T> of(
		Map<String, Map<String, String>> actions, Collection<T> items); static Page<T> of(
		Map<String, Map<String, String>> actions, Collection<T> items,
		Pagination pagination, long totalCount); static Page<T> of(
		Map<String, Map<String, String>> actions, List<Facet> facets,
		Collection<T> items, Pagination pagination, long totalCount); @JsonProperty("actions") Map<String, Map<String, String>> getActions(); @JsonProperty("facets") List<Facet> getFacets(); @JacksonXmlElementWrapper(localName = "items") @JacksonXmlProperty(localName = "item") Collection<T> getItems(); long getLastPage(); @JsonProperty("page") long getPage(); @JsonProperty("pageSize") long getPageSize(); long getTotalCount(); boolean hasNext(); boolean hasPrevious();  }
@Test public void testOf() { Page<Integer> page = Page.of(Collections.emptyList()); assertThat(page.getItems(), is(empty())); assertThat(page.getLastPage(), is(1L)); assertThat(page.getPage(), is(1L)); assertThat(page.getPageSize(), is(0L)); assertThat(page.getTotalCount(), is(0L)); assertThat(page.hasNext(), is(false)); assertThat(page.hasPrevious(), is(false)); page = Page.of(Arrays.asList(1, 2, 3)); assertThat(page.getItems(), contains(1, 2, 3)); assertThat(page.getLastPage(), is(1L)); assertThat(page.getPage(), is(1L)); assertThat(page.getPageSize(), is(3L)); assertThat(page.getTotalCount(), is(3L)); assertThat(page.hasNext(), is(false)); assertThat(page.hasPrevious(), is(false)); page = Page.of(Arrays.asList(1, 2, 3), Pagination.of(3, 3), 25); assertThat(page.getItems(), contains(1, 2, 3)); assertThat(page.getLastPage(), is(9L)); assertThat(page.getPage(), is(3L)); assertThat(page.getPageSize(), is(3L)); assertThat(page.getTotalCount(), is(25L)); assertThat(page.hasNext(), is(true)); assertThat(page.hasPrevious(), is(true)); }