GridListDataView extends AbstractListDataView<T> { @Override public int getItemCount() { return dataCommunicator.getItemCount(); } GridListDataView(DataCommunicator<T> dataCommunicator,
                            Grid<T> grid); @Override Stream<T> getItems(); @Override int getItemCount(); @Override void setIdentifierProvider(
            IdentifierProvider<T> identifierProvider);  }
@Test public void dataView_setFilter_methodsUseFilteredData() { String[] items = new String[] { "item1", "item2", "item3", "item4" }; Grid<String> grid = new Grid<>(); GridListDataView<String> dataView = grid.setItems(items); dataView.setFilter(s -> s.endsWith("4")); Assert.assertEquals("Filter was not applied to data size", 1, dataView.getItemCount()); Assert.assertTrue("Expected item is missing from filtered data", dataView.contains(items[3])); Assert.assertFalse( "Item that should be filtered out is available in the data", dataView.contains(items[1])); Assert.assertEquals("Wrong item on row for filtered data.", items[3], dataView.getItem(0)); }