@Test
    public void testAddSerialization() {
        FieldUpdate update = FieldUpdate.createAdd(field, new StringFieldValue("value1"));
        DocumentSerializer buffer = DocumentSerializerFactory.createHead(new GrowableByteBuffer());
        update.serialize(buffer);

        buffer.getBuf().rewind();

        try{
            FileOutputStream fos = new FileOutputStream("src/test/files/addfieldser.dat");
            fos.write(buffer.getBuf().array(), 0, buffer.getBuf().remaining());
            fos.close();
        } catch (Exception e) {}

        FieldUpdate deserializedUpdate = new FieldUpdate(DocumentDeserializerFactory.createHead(new DocumentTypeManager(), buffer.getBuf()), documentType);
        assertEquals("'field1' [add value1 1]", 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