DataProvider { public void setPageSize(int pageSize) { int oldPageSize = pageInfo.getPageSize(); pageInfo.setPageSize(pageSize); if (oldPageSize != pageInfo.getPageSize()) { applyFilterSortAndPaging(); showItems(); updateSelection(); } } DataProvider(Function<T, String> identifier, boolean multiSelect);   DataProvider(Function<T, String> identifier, boolean multiSelect, int pageSize); void update(Iterable<T> items); boolean contains(T item); boolean isVisible(T item); String getId(T item); Iterable<T> getAllItems(); Iterable<T> getFilteredItems(); Iterable<T> getVisibleItems(); void onSelect(SelectHandler<T> selectHandler); void selectAll(); void selectVisible(); void clearAllSelection(); void clearVisibleSelection(); void select(T item, boolean select); SelectionInfo<T> getSelectionInfo(); void addFilter(String name, FilterValue<T> filter); void removeFilter(String name); void clearFilters(); @SuppressWarnings("unchecked") FilterValue<T> getFilter(String name); boolean hasFilters(); void setComparator(Comparator<T> comparator); Comparator<T> getComparator(); void setPageSize(int pageSize); void gotoFirstPage(); void gotoPreviousPage(); void gotoNextPage(); void gotoLastPage(); void gotoPage(int page); PageInfo getPageInfo(); void addDisplay(Display<T> display);  }
@Test public void setPageSize() throws Exception { int[] items = items(PAGE_SIZE); single.update(asList(items)); assertVisibleFilteredAll(single, items(PAGE_SIZE), items, items); verify(display).showItems(itemsMatcher(items(PAGE_SIZE)), eq(new PageInfo(PAGE_SIZE, 0, PAGE_SIZE, PAGE_SIZE))); single.setPageSize(6); assertVisibleFilteredAll(single, items(6), items, items); verify(display).showItems(itemsMatcher(items(6)), eq(new PageInfo(6, 0, 6, PAGE_SIZE))); }