@Test
public void writeEmbeddedObject() throws Exception {

    Vertex component1 = graph.addVertex(
            T.label, Bdio.Class.Component.name(),
            TT.id, BdioObject.randomId());
    Vertex component2 = graph.addVertex(
            T.label, Bdio.Class.Component.name(),
            TT.id, BdioObject.randomId());
    Vertex dependency = graph.addVertex(
            T.label, Bdio.Class.Dependency.name());
    component2.addEdge(Bdio.ObjectProperty.dependency.name(), dependency);
    dependency.addEdge(Bdio.ObjectProperty.dependsOn.name(), component1);
    commit();
    HeapOutputStream outputStream = new HeapOutputStream();
    graph.io(testBdio(TT.Metadata, TT.id)).writeGraph(new BdioFile(outputStream));
    List<String> entries = BdioTest.zipEntries(outputStream.getInputStream());
    assertThat(entries).hasSize(2);
    assertThatJson(entries.get(1)).arrayAt("/@graph").hasSize(2); // Just the two components
    assertThatJson(entries.get(1)).at("@graph", 1, Bdio.ObjectProperty.dependency, 0, Bdio.ObjectProperty.dependsOn, 0, "@id")
            .isEqualTo(component1.value(TT.id));
}