public static < T > PaginationResult < T > paginate ( final Integer startPage , final int pageSize , final List < T > fullDataSet ) { return paginate ( startPage , pageSize , ( start , length ) -> { final int len = fullDataSet . size ( ) ; if ( start > len ) { return Collections . emptyList ( ) ; } return fullDataSet . subList ( start , Math . min ( start + length , len ) ) ; } ) ; }
Paginate from a full data set