DocumentUpdate createUpdate() {
            var result = new DocumentUpdate(docType, "id:test:test::0");

            result.addFieldUpdate(FieldUpdate.create(getField("sparse_tensor"))
                    .addValueUpdate(new AssignValueUpdate(createTensor()))
                    .addValueUpdate(new TensorAddUpdate(createTensor()))
                    .addValueUpdate(new TensorRemoveUpdate(createTensor())));

            result.addFieldUpdate(FieldUpdate.create(getField("dense_tensor"))
                    .addValueUpdate(new TensorModifyUpdate(TensorModifyUpdate.Operation.REPLACE, createTensor()))
                    .addValueUpdate(new TensorModifyUpdate(TensorModifyUpdate.Operation.ADD, createTensor()))
                    .addValueUpdate(new TensorModifyUpdate(TensorModifyUpdate.Operation.MULTIPLY, createTensor()))
                    .addValueUpdate(new TensorModifyUpdate(TensorModifyUpdate.Operation.REPLACE, createTensor(), true))
                    .addValueUpdate(new TensorModifyUpdate(TensorModifyUpdate.Operation.ADD, createTensor(), true))
                    .addValueUpdate(new TensorModifyUpdate(TensorModifyUpdate.Operation.MULTIPLY, createTensor(), true)));
            return result;
        }
Tests applying and serializing document updates.

@author Einar M R Rosenvinge
document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java