public void serialize(String docId) {
            new Document(docType, DocumentId.createFromSerialized(docId))
                    .serialize(DocumentSerializerFactory.createHead(buffer));
            buffer.flip();
        }
Test for Document and all its features, including (de)serialization.

@author Thomas Gundersen
@author bratseth
document/src/test/java/com/yahoo/document/DocumentTestCase.java