@Override
    public int count(Map<String, FilterMeta> filterBy) {
        return (int) datasource.stream()
                .filter(o -> filter(FacesContext.getCurrentInstance(), filterBy.values(), o))
                .count();
    }
Dummy implementation of LazyDataModel that uses a list to mimic a real datasource like a database.
primefaces-showcase/src/main/java/org/primefaces/showcase/view/data/datatable/LazyCustomerDataModel.java