@Override
    public List<Customer> load(int offset, int pageSize, Map<String, SortMeta> sortBy, Map<String, FilterMeta> filterBy) {
        // apply filters
        List<Customer> customers = datasource.stream()
                .filter(o -> filter(FacesContext.getCurrentInstance(), filterBy.values(), o))
                .collect(Collectors.toList());

        // sort
        if (!sortBy.isEmpty()) {
            List<Comparator<Customer>> comparators = sortBy.values().stream().map(o -> new CustomerLazySorter(o.getField(), o.getOrder()))
                    .collect(Collectors.toList());
            Comparator<Customer> cp = ComparatorUtils.chainedComparator(comparators); // from apache
            customers.sort(cp);
        }

        // apply offset & limit
        return customers.subList(offset, Math.min(offset + pageSize, customers.size()));
    }
Dummy implementation of LazyDataModel that uses a list to mimic a real datasource like a database.
primefaces-integration-tests/src/main/java/org/primefaces/integrationtests/datatable/CustomerLazyDataModel.java