@Test
    public void testThatClearCanBePrunedIfNoneExisting() {
        Field field = docType.getField("strfoo");
        Document doc = createDocument();
        StringFieldValue expected = new StringFieldValue("some value");
        expected.clear();
        doc.setFieldValue(field, expected);
        DocumentUpdate update = new DocumentUpdate(docType, new DocumentId(documentId));
        update.addFieldUpdate(FieldUpdate.createClearField(field));
        update.prune(doc);
        assertEquals(0, update.size());
        update.applyTo(doc);
        assertEquals(expected, doc.getFieldValue(field));
    }
Tests applying and serializing document updates.

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