public void selectRow(String rowKey) {
        getSelectedRowKeys().add(rowKey);
        if (isMultiViewState()) {
            DataTableState mvs = getMultiViewState(true);
            if (mvs.getSelectedRowKeys() == null) {
                mvs.setSelectedRowKeys(new HashSet<>());
            }
            mvs.getSelectedRowKeys().add(rowKey);
        }
    }
Recalculates filteredValue after adding, updating or removing rows to/from a filtered DataTable.
NOTE: this is only supported for non-lazy DataTables, eg bound to a java.util.List.
primefaces/src/main/java/org/primefaces/component/datatable/DataTable.java