Paging implements ImmutableBean { public static Paging of(final PagingRequest pagingRequest, final int totalItems) { return new Paging(pagingRequest, totalItems); } @ImmutableConstructor private  Paging(final PagingRequest pagingRequest, final int totalItems); static Paging of(final PagingRequest pagingRequest, final int totalItems); static Paging ofAll(final Collection<?> coll); static Paging of(PagingRequest pagingRequest, Collection<?> coll); PagingRequest getRequest(); int getTotalItems(); int getFirstItem(); int getFirstItemOneBased(); int getLastItem(); int getLastItemOneBased(); int getPageNumber(); int getPagingSize(); int getTotalPages(); boolean isSizeOnly(); boolean isNextPage(); boolean isLastPage(); boolean isPreviousPage(); boolean isFirstPage(); PagingRequest toPagingRequest(); PagingRequest nextPagingRequest(); PagingRequest previousPagingRequest(); @Override String toString(); static Paging.Meta meta(); @Override Paging.Meta metaBean(); @Override Property<R> property(String propertyName); @Override Set<String> propertyNames(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_factory_of_PagingRequest_int_totalItemsNegative() { Paging.of(PagingRequest.ofPage(1, 20), -1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_factory_of_PagingRequest_int_null() { Paging.of(null, 0); }