ComponentGrid extends Grid { public ComponentGrid<T> addAll(Collection<T> beans) { componentGridDecorator.addAll(beans); return this; } ComponentGrid(Class<T> typeOfRows); ComponentGridDecorator<T> getComponentGridDecorator(); FocusPreserveExtension getFocusPreserveExtension(); ComponentGrid<T> remove(T bean); ComponentGrid<T> add(T bean); ComponentGrid<T> addAll(Collection<T> beans); Grid.Column addComponentColumn(Object propertyId, ComponentGenerator<T> generator); ComponentGrid<T> refresh(); ComponentGrid<T> setRows(Collection<T> beans); ComponentGrid<T> generateHeaders(ComponentHeaderGenerator generator); ComponentGrid<T> generateHeaders(TextHeaderGenerator generator); ComponentGrid<T> generateHeaders(HtmlHeaderGenerator generator);  }
@Test public void testAddAll() { ComponentGrid grid = createTestGrid(); assertThat(grid.getContainerDataSource().getItemIds().size(), is(10)); List<ExampleBean> moreBeans = new ArrayList<>(); for(int i = 10; i < 20;i++) { ExampleBean bean = new ExampleBean(); bean.setCaption("foo" +i); bean.setIsSomething(true); moreBeans.add(bean); } grid.addAll(moreBeans); assertThat(grid.getContainerDataSource().getItemIds().size(), is(20)); }