AbstractListDataView extends AbstractDataView<T> implements ListDataView<T, AbstractListDataView<T>> { @Override public AbstractListDataView<T> removeItems(Collection<T> items) { Objects.requireNonNull(items, NULL_COLLECTION_ERROR_MESSAGE); if (items.isEmpty()) { return this; } final ListDataProvider<T> dataProvider = getDataProvider(); items.forEach(item -> removeItemIfPresent(item, dataProvider)); dataProvider.refreshAll(); return this; } AbstractListDataView(
            SerializableSupplier<? extends DataProvider<T, ?>> dataProviderSupplier,
            Component component); @Override int getItemCount(); @Override T getItem(int index); @Override Optional<T> getNextItem(T item); @Override Optional<T> getPreviousItem(T item); @Override AbstractListDataView<T> addFilter(SerializablePredicate<T> filter); @Override AbstractListDataView<T> removeFilters(); @Override AbstractListDataView<T> setFilter(SerializablePredicate<T> filter); @Override AbstractListDataView<T> setSortComparator(
            SerializableComparator<T> sortComparator); @Override AbstractListDataView<T> addSortComparator(
            SerializableComparator<T> sortComparator); @Override AbstractListDataView<T> removeSorting(); @Override AbstractListDataView<T> setSortOrder(
            ValueProvider<T, V1> valueProvider, SortDirection sortDirection); @Override AbstractListDataView<T> addSortOrder(
            ValueProvider<T, V1> valueProvider, SortDirection sortDirection); @Override boolean contains(T item); @Override AbstractListDataView<T> addItem(T item); @Override AbstractListDataView<T> addItems(Collection<T> items); @Override AbstractListDataView<T> addItemAfter(T item, T after); @Override AbstractListDataView<T> addItemBefore(T item, T before); @Override AbstractListDataView<T> addItemsAfter(Collection<T> items, T after); @Override AbstractListDataView<T> addItemsBefore(Collection<T> items,
            T before); @Override AbstractListDataView<T> removeItem(T item); @Override AbstractListDataView<T> removeItems(Collection<T> items);  }
@Test public void removeItems_itemsOutOfOrder_allItemsAreRemoved() { dataView.removeItems(Arrays.asList("middle", "first")); Assert.assertArrayEquals(new String[] { "last" }, dataView.getItems().toArray(String[]::new)); }
@Test public void removeItems_nullCollectionPassed_throwsException() { exceptionRule.expect(NullPointerException.class); exceptionRule.expectMessage("Items collection cannot be null"); dataView.removeItems(null); }
@Test public void removeItems_emptyCollectionPassed_dataNotChanged() { dataView.removeItems(Collections.emptyList()); Assert.assertArrayEquals(new String[] { "first", "middle", "last" }, dataView.getItems().toArray(String[]::new)); }