private static ByteBuffer writeFile(StringFieldValue value, String fileName) throws IOException {
        fileName = PATH + fileName;

        //serialize our tree to buffer
        DocumentSerializer serializer = DocumentSerializerFactory.createHead(new GrowableByteBuffer());
        serializer.write(null, value);
        ByteBuffer serializedBuf = serializer.getBuf().getByteBuffer();
        serializedBuf.flip();

        //write our tree to disk
        File file = new File(fileName);
        FileChannel wChannel = new FileOutputStream(file, false).getChannel();
        wChannel.write(serializedBuf);
        wChannel.close();

        serializedBuf.position(0);
        return serializedBuf;
    }
Tests that serialization of annotations from Java generates the
output expected by the C++ deserialization system.

If the format changes and this test starts failing, you should
generate new golden files to check against. This will cause the C++
test to fail, so you will need to update the
AnnotationDeserialization component to handle the format changes.
document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java