@Test
    public void get_serialized_size_uses_latest_serializer() {
        DocumentType docType = new DocumentType("my_type");
        docType.addField("my_str", DataType.STRING);
        docType.addField("my_int", DataType.INT);
        Document doc = new Document(docType, "id:ns:my_type::");
        doc.setFieldValue("my_str", new StringFieldValue("foo"));
        doc.setFieldValue("my_int", new IntegerFieldValue(69));

        GrowableByteBuffer buf = new GrowableByteBuffer();
        doc.serialize(buf);
        assertEquals(buf.position(), VespaDocumentSerializerHead.getSerializedSize(doc));
    }
@author Simon Thoresen Hult
@author vekterli
document/src/test/java/com/yahoo/document/serialization/VespaDocumentSerializerTestCase.java