@Test void getPageResponseTotalPagesRounding() { PageResponse pageResponse = PageResponse.builder() .setSize(10) .setNumber(0) .setTotalPages(9) .setTotalElements(89) .build(); assertEquals(pageResponse, PageUtils.getPageResponse(10, 0, 89)); }
public static PageResponse getPageResponse(int pageSize, int offset, int total) { int newNumber = offset / pageSize; return PageResponse.create(pageSize, total, newNumber); }
PageUtils { public static PageResponse getPageResponse(int pageSize, int offset, int total) { int newNumber = offset / pageSize; return PageResponse.create(pageSize, total, newNumber); } }
PageUtils { public static PageResponse getPageResponse(int pageSize, int offset, int total) { int newNumber = offset / pageSize; return PageResponse.create(pageSize, total, newNumber); } private  PageUtils(); }
PageUtils { public static PageResponse getPageResponse(int pageSize, int offset, int total) { int newNumber = offset / pageSize; return PageResponse.create(pageSize, total, newNumber); } private  PageUtils(); static PageResponse getPageResponse(int pageSize, int offset, int total); static int getTotalPages(int pageSize, int totalElements); }
PageUtils { public static PageResponse getPageResponse(int pageSize, int offset, int total) { int newNumber = offset / pageSize; return PageResponse.create(pageSize, total, newNumber); } private  PageUtils(); static PageResponse getPageResponse(int pageSize, int offset, int total); static int getTotalPages(int pageSize, int totalElements); static final String PAGE_QUERY_PARAMETER_NAME; }