class PaginationFilter implements Function<ListResult<T>, ListResult<T>> {

    @Override
    public ListResult<T> apply(ListResult<T> result) {
        List<T> list = result.getItems();
        if (startIndex >= list.size()) {
            list = Collections.emptyList();
        } else {
            list = list.subList(startIndex, Math.min(list.size(), endIndex));
        }
        return new ListResult.Builder<T>().createFrom(result).items(list).build();
    }

    public  PaginationFilter(PaginationOptions options);

}