private DocumentUpdate createDocumentUpdateForSerialization() {
        docMan = DocumentTestCase.setUpCppDocType();
        docType = docMan.getDocumentType("serializetest");

        DocumentUpdate docUp = new DocumentUpdate(docType, new DocumentId("id:ns:serializetest::xlanguage"));

        AssignFieldPathUpdate ass = new AssignFieldPathUpdate(docType, "intfield", "", "3");
        ass.setCreateMissingPath(false);
        ass.setRemoveIfZero(true);
        docUp.addFieldPathUpdate(ass);

        Array fArray = new Array(docType.getField("arrayoffloatfield").getDataType());
        fArray.add(new FloatFieldValue(12.0f));
        fArray.add(new FloatFieldValue(5.0f));

        AddFieldPathUpdate add = new AddFieldPathUpdate(docType, "arrayoffloatfield", "", fArray);
        docUp.addFieldPathUpdate(add);

        RemoveFieldPathUpdate remove = new RemoveFieldPathUpdate(docType, "intfield", "serializetest.intfield > 0");
        docUp.addFieldPathUpdate(remove);

        return docUp;
    }
Tests applying and serializing document updates.

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