bundles/org.eclipse.packagedrone.web.common/src/org/eclipse/packagedrone/web/common/page/Pagination.java
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 ) );
        } );
    }
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

@param startPage
the start page
@param pageSize
the size of a single page
@param fullDataSet
the full data set
@return a subset of the full data set, containing the items which match
the page window