@Test
public void nodeAndRelationship() throws ReportException {

    MapBuilder<String, Object> builder = MapBuilder.builder();
    Map<String, Object> nodeProperties = MapBuilder.<String, Object> builder().entry("nodeKey", "value").build();
    builder.entry("node", getNeo4jNode(1l, nodeProperties, "Test1", "Test2"));
    Map<String, Object> relationshipProperties = MapBuilder.<String, Object> builder().entry("relationshipKey", "value").build();
    builder.entry("relation", getNeo4jRelationship(1l, relationshipProperties, "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(1);
    Node node = nodes.get(1l);
    assertThat(node.getId()).isEqualTo(1l);
    assertThat(node.getLabels()).containsExactly("Test1", "Test2");
    assertThat(node.getProperties()).isEqualTo(nodeProperties);
    Map<Long, Relationship> relationships = graph.getRelationships();
    assertThat(relationships).hasSize(1);
    Relationship relationship = relationships.get(1l);
    assertThat(relationship.getId()).isEqualTo(1l);
    assertThat(relationship.getType()).isEqualTo("TEST");
    assertThat(relationship.getProperties()).isEqualTo(relationshipProperties);
}