public static Document deserializeDocument(byte[] buf, TestDocumentFactory factory) {
        Document document = factory.createDocument();
        DocumentDeserializerFactory.createHead(factory.typeManager(), new GrowableByteBuffer(ByteBuffer.wrap(buf))).read(document);
        return document;
    }
Helper class with utils used in serialization and deserialization test cases.

@author geirst
document/src/test/java/com/yahoo/document/serialization/SerializationTestUtils.java