Pagination { public static Pagination of(int page, int pageSize) { return new Pagination(page, pageSize); } private  Pagination(int page, int pageSize); static Pagination of(int page, int pageSize); int getEndPosition(); int getPage(); int getPageSize(); int getStartPosition();  }
@Test public void testOf() { Pagination pagination = Pagination.of(3, 30); assertThat(pagination.getEndPosition(), is(90)); assertThat(pagination.getPage(), is(3)); assertThat(pagination.getPageSize(), is(30)); assertThat(pagination.getStartPosition(), is(60)); }