DataCommunicator implements Serializable { public void setPageSize(int pageSize) { if (pageSize < 1) { throw new IllegalArgumentException(String.format( "Page size cannot be less than 1, got %d", pageSize)); } this.pageSize = pageSize; } DataCommunicator(DataGenerator<T> dataGenerator,
            ArrayUpdater arrayUpdater,
            SerializableConsumer<JsonArray> dataUpdater, StateNode stateNode);  DataCommunicator(DataGenerator<T> dataGenerator,
            ArrayUpdater arrayUpdater,
            SerializableConsumer<JsonArray> dataUpdater, StateNode stateNode,
            boolean fetchEnabled); void setRequestedRange(int start, int length); void reset(); void refresh(T data); void confirmUpdate(int updateId); DataProvider<T, ?> getDataProvider(); SerializableConsumer<F> setDataProvider(
            DataProvider<T, F> dataProvider, F initialFilter); int getItemCount(); boolean isItemActive(T item); @SuppressWarnings("unchecked") T getItem(int index); Query buildQuery(int offset, int limit); void setPageSize(int pageSize); int getPageSize(); void setCountCallback(
            CallbackDataProvider.CountCallback<T, ?> countCallback); void setItemCountEstimate(int itemCountEstimate); int getItemCountEstimate(); void setItemCountEstimateIncrease(int itemCountEstimateIncrease); int getItemCountEstimateIncrease(); void setDefinedSize(boolean definedSize); boolean isDefinedSize(); DataKeyMapper<T> getKeyMapper(); void setInMemorySorting(SerializableComparator<T> comparator); SerializableComparator<T> getInMemorySorting(); void setBackEndSorting(List<QuerySortOrder> sortOrder); List<QuerySortOrder> getBackEndSorting(); boolean isPagingEnabled(); void setPagingEnabled(boolean pagingEnabled); boolean isFetchEnabled(); void setFetchEnabled(boolean fetchEnabled); void fireItemCountEvent(int itemCount); static final int DEFAULT_PAGE_INCREASE_COUNT; }
@Test public void setPageSize_setIncorrectPageSize_throws() { expectedException.expect(IllegalArgumentException.class); expectedException .expectMessage("Page size cannot be less than 1, got 0"); dataCommunicator.setPageSize(0); }