@Test
    public void non_empty_reference_field_results_in_reference_value_with_doc_id_present() throws IOException {
        final Document doc = readDocumentFromJson("id:unittest:testrefs::helloworld",
                "{ \"ref_field\": \"id:unittest:smoke::and_mirrors_too\" }");
        ReferenceFieldValue ref = (ReferenceFieldValue)doc.getFieldValue("ref_field");
        assertTrue(ref.getDocumentId().isPresent());
        assertEquals(new DocumentId("id:unittest:smoke::and_mirrors_too"), ref.getDocumentId().get());
    }
Functional tests for com.yahoo.document.json.JsonWriter.

@author Steinar Knutsen
document/src/test/java/com/yahoo/document/json/JsonWriterTestCase.java