ListDataProvider extends AbstractDataProvider<T, SerializablePredicate<T>> implements InMemoryDataProvider<T> { @Override public int size(Query<T, SerializablePredicate<T>> query) { return (int) getFilteredStream(query).count(); } ListDataProvider(Collection<T> items); Collection<T> getItems(); @Override Stream<T> fetch(Query<T, SerializablePredicate<T>> query); @Override int size(Query<T, SerializablePredicate<T>> query); @Override SerializableComparator<T> getSortComparator(); @Override void setSortComparator(SerializableComparator<T> comparator); @Override SerializablePredicate<T> getFilter(); @Override void setFilter(SerializablePredicate<T> filter);  }
@Test public void combineProviderAndQueryFilters() { dataProvider.addFilterByValue(StrBean::getValue, "Foo"); int size = dataProvider.size(new Query<>(item -> item.getId() > 50)); Assert.assertEquals("Both filters should be used", 17, size); }
@Test public void combineProviderAndQueryFilters() { dataProvider.addFilterByValue(StrBean::getValue, "Foo"); int size = dataProvider.size(new Query<>(item -> item.getId() > 50)); assertEquals("Both filters should be used", 17, size); }