@Test
    public void testSetGet() {
        Document doc = new Document(docMan.getDocumentType("testdoc"), new DocumentId("id:ns:testdoc::test"));
        Object val = doc.getFieldValue(minField.getName());
        assertNull(val);
        doc.setFieldValue(minField.getName(), 500);
        val = doc.getFieldValue(minField.getName());
        assertEquals(new IntegerFieldValue(500), val);
        val = doc.getFieldValue(minField.getName());
        assertEquals(new IntegerFieldValue(500), val);
        doc.removeFieldValue(minField);
        assertNull(doc.getFieldValue(minField.getName()));
        assertNull(doc.getFieldValue("doesntexist"));
    }
Test for Document and all its features, including (de)serialization.

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