AbstractLazyDataView extends AbstractDataView<T> implements LazyDataView<T> { @Override public void setItemCountUnknown() { getDataCommunicator().setDefinedSize(false); } AbstractLazyDataView(DataCommunicator<T> dataCommunicator,
            Component component); @Override T getItem(int index); @SuppressWarnings("unchecked") @Override Stream<T> getItems(); @Override void setItemCountEstimate(int itemCountEstimate); @Override int getItemCountEstimate(); @Override void setItemCountEstimateIncrease(int itemCountEstimateIncrease); @Override int getItemCountEstimateIncrease(); @Override void setItemCountFromDataProvider(); @Override void setItemCountUnknown();  }
@Test(expected = IllegalStateException.class) public void dataViewAPIUsed_beforeSettingDataProvider_throws() { AbstractLazyDataView<String> dataView = new AbstractLazyDataView<String>( new DataCommunicator<>((item, jsonObject) -> { }, null, null, component.getElement().getNode()), component) { }; dataView.setItemCountUnknown(); }
@Test(expected = IllegalStateException.class) public void existingDataView_dataProviderIsChangedToInMemory_throws() { dataCommunicator.setDataProvider(badProvider, null); dataView.setItemCountUnknown(); }