@Test
    public void testAddSerialization() {
        DocumentUpdate docUp = new DocumentUpdate(docType, new DocumentId("id:ns:foobar::bar"));
        Array strArray = new Array(docType.getField("strarray").getDataType());
        strArray.add(new StringFieldValue("hello hello"));
        strArray.add(new StringFieldValue("blah blah"));

        AddFieldPathUpdate add = new AddFieldPathUpdate(docType, "strarray", "", strArray);
        docUp.addFieldPathUpdate(add);

        GrowableByteBuffer buffer = new GrowableByteBuffer();
        docUp.serialize(DocumentSerializerFactory.createHead(buffer));
        buffer.flip();
        DocumentUpdate docUp2 = new DocumentUpdate(DocumentDeserializerFactory.createHead(docMan, buffer));

        assertEquals(docUp, docUp2);
    }
Tests applying and serializing document updates.

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