@Test
public void collectionOfNodesAndCollectionOfRelationships() throws ReportException {

    MapBuilder<String, Object> builder = MapBuilder.builder();
    builder.entry("nodes", asList(getNeo4jNode(1l), getNeo4jNode(2l)));
    builder.entry("relations", asList(getNeo4jRelationship(1l, "TEST"), getNeo4jRelationship(2l, "TEST")));
    Result<ExecutableRule> result = Result.builder().rows(singletonList(builder.build())).build();
    SubGraph graph = factory.createSubGraph(result);
    assertThat(graph.getId()).isEqualTo(-1l);
    assertThat(graph.getParent()).isNull();
    assertThat(graph.getSubGraphs()).isEmpty();
    Map<Long, Node> nodes = graph.getNodes();
    assertThat(nodes).hasSize(2);
    Node node1 = nodes.get(1l);
    assertThat(node1.getId()).isEqualTo(1l);
    Node node2 = nodes.get(2l);
    assertThat(node2.getId()).isEqualTo(2l);
    Map<Long, Relationship> relationships = graph.getRelationships();
    assertThat(relationships).hasSize(2);
    Relationship relationship1 = relationships.get(1l);
    assertThat(relationship1.getId()).isEqualTo(1l);
    Relationship relationship2 = relationships.get(2l);
    assertThat(relationship2.getId()).isEqualTo(2l);
}