@Test
public void virtualRelationship() throws ReportException {

    Map<Object, Object> properties = MapBuilder.builder().entry("key", "value").build();
    Map<String, Object> virtualNode = MapBuilder.<String, Object> builder() //
            .entry("role", "relationship") //
            .entry("label", "Virtual Relationship") //
            .entry("type", "TEST") //
            .entry("properties", properties) //
            .entry("startNode", getNeo4jNode(1l)) //
            .entry("endNode", getNeo4jNode(2l)) //
            .build();
    MapBuilder<String, Object> builder = MapBuilder.builder();
    builder.entry("relationships", singletonList(virtualNode));
    Result<ExecutableRule> result = Result.builder().rows(singletonList(builder.build())).build();
    SubGraph graph = factory.createSubGraph(result);
    Map<Long, Relationship> relationships = graph.getRelationships();
    assertThat(relationships.size()).isEqualTo(1);
    Relationship relationship = relationships.get(-1l);
    assertThat(relationship).isNotNull();
    assertThat(relationship.getId()).isEqualTo(-1l);
    assertThat(relationship.getLabel()).isEqualTo("Virtual Relationship");
    assertThat(relationship.getType()).isEqualTo("TEST");
    assertThat(relationship.getProperties()).isEqualTo(properties);
    Node startNode = relationship.getStartNode();
    assertThat(startNode).isNotNull();
    assertThat(startNode.getId()).isEqualTo(1l);
    Node endNode = relationship.getEndNode();
    assertThat(endNode).isNotNull();
    assertThat(endNode.getId()).isEqualTo(2l);
}