@Test
public void testDocumentGraphWithDocument() throws UIMAException {
DocumentGraphOptions options = DocumentGraphOptions.builder().withDocument(true).build();
DocumentGraphFactory factory = createfactory(options);
JCas jCas = JCasFactory.createJCas();
JCasTestGraphUtil.populateJcas(jCas);
Graph graph = factory.create(jCas);
assertEquals(1, graph.traversal().V().hasLabel(DOCUMENT).count().next().intValue());
assertEquals(10, graph.traversal().E().hasLabel(MENTION_IN).count().next().intValue());
assertEquals(2, graph.traversal().V().hasLabel(RELATION).count().next().intValue());
assertEquals(2, graph.traversal().E().hasLabel(SOURCE).count().next().intValue());
assertEquals(2, graph.traversal().E().hasLabel(TARGET).count().next().intValue());
assertEquals(3, graph.traversal().V().hasLabel(REFERENCE_TARGET).count().next().intValue());
assertEquals(1, graph.traversal().V().hasLabel(EVENT).count().next().intValue());
assertEquals(4, graph.traversal().V().hasLabel(MENTION).count().next().intValue());
assertEquals(4, graph.traversal().E().hasLabel(MENTION_OF).count().next().intValue());
assertEquals(0, graph.traversal().E().hasLabel(RELATION).count().next().intValue());
assertEquals(2, graph.traversal().E().hasLabel(PARTICIPANT_IN).count().next().intValue());
assertEquals(11, IteratorUtils.count(graph.vertices()));
assertEquals(20, IteratorUtils.count(graph.edges()));
DocumentAnnotation da = UimaSupport.getDocumentAnnotation(jCas);
String documentId = ConsumerUtils.getExternalId(da, false);
Vertex documentVert = graph.traversal().V(documentId).next();
Map<String, Object> properties = new HashMap<>();
documentVert.properties().forEachRemaining(vp -> properties.put(vp.key(), vp.value()));
assertMetadata(jCas, properties);
}