@Test
    public void testClearSerialization() {
        FieldUpdate update = FieldUpdate.createClear(field);
        DocumentSerializer buffer = DocumentSerializerFactory.createHead(new GrowableByteBuffer());
        update.serialize(buffer);

        buffer.getBuf().rewind();
        FieldUpdate deserializedUpdate = new FieldUpdate(DocumentDeserializerFactory.createHead(new DocumentTypeManager(), buffer.getBuf()), documentType);

        assertEquals("'field1' [clear]", deserializedUpdate.toString());
    }
NOTE: Roundtrip serialization (JSON -> DocumentUpdate -> ByteBuffer -> DocumentUpdate -> JSON) of updates is tested in DocumentUpdateJsonSerializerTest.
      Consider adding new test cases to that test class instead.

@author bratseth
document/src/test/java/com/yahoo/document/update/SerializationTestCase.java