@Test
    public void testBug2354045() {
        DocumentTypeManager docMan = new DocumentTypeManager();
        DocumentType docType = new DocumentType("bug2354045");
        docType.addField(new Field("string", DataType.STRING));
        docMan.register(docType);

        GrowableByteBuffer grbuf = new GrowableByteBuffer();

        Document doc = new Document(docType, new DocumentId("id:ns:bug2354045::strings"));

        doc.removeFieldValue("string");
        assertNull(doc.getFieldValue("string"));

        doc.getSerializedSize();
        doc.serialize(grbuf);

        grbuf.flip();

        Document doc2 = docMan.createDocument(grbuf);
        assertNull(doc2.getFieldValue("string"));
        assertEquals(doc, doc2);
    }
Test for Document and all its features, including (de)serialization.

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