AbstractGridMultiSelectionModel extends AbstractGridExtension<T> implements GridMultiSelectionModel<T> { @Override public void selectFromClient(T item) { if (isSelected(item)) { return; } Set<T> oldSelection = new LinkedHashSet<>(selected); boolean added = selected.add(item); if (added) { fireSelectionEvent(new MultiSelectionEvent<>(getGrid(), getGrid().asMultiSelect(), oldSelection, true)); long size = 0; final DataProvider<T, ?> dataProvider = getGrid() .getDataCommunicator().getDataProvider(); if (!(dataProvider instanceof HierarchicalDataProvider)) { size = dataProvider.size(new Query<>()); } selectionColumn.setSelectAllCheckboxState(size == selected.size()); } } AbstractGridMultiSelectionModel(Grid<T> grid); @Override void selectFromClient(T item); @Override void deselectFromClient(T item); @Override Set<T> getSelectedItems(); @Override Optional<T> getFirstSelectedItem(); @Override void select(T item); @Override void deselect(T item); @Override void selectAll(); @Override void deselectAll(); @Override void updateSelection(Set<T> addedItems, Set<T> removedItems); @Override boolean isSelected(T item); @Override MultiSelect<Grid<T>, T> asMultiSelect(); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override Registration addSelectionListener(
            SelectionListener<Grid<T>, T> listener); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override Registration addMultiSelectionListener(
            MultiSelectionListener<Grid<T>, T> listener); @Override void setSelectAllCheckboxVisibility(
            SelectAllCheckboxVisibility selectAllCheckBoxVisibility); @Override SelectAllCheckboxVisibility getSelectAllCheckboxVisibility(); @Override boolean isSelectAllCheckboxVisible(); @Override void generateData(T item, JsonObject jsonObject); @Override void setSelectionColumnFrozen(boolean frozen); @Override boolean isSelectionColumnFrozen();  }
@Test public void select_singleItemSignature_selectFormClient_dontSendToClientSide() { grid.setSelectionMode(SelectionMode.MULTI); grid.setItems("foo", "bar"); grid.getSelectionModel().selectFromClient("foo"); Assert.assertEquals(0, selected.size()); }