class VarDependencies {

    public List<Relationship> getRelationships(ClauseId clauseId) {
        return Collections.unmodifiableList(this.relationships.get(clauseId));
    }

}

class VarDependenciesTest  {

    @Test
    public void testRelationships() {

        String cypher = "" +
                "MATCH (a)--(b)\n" +
                "RETURN 42";
        Statement st = PassAvailables.parseCypher(cypher);
        SingleQuery sq = (SingleQuery) st.query.part;
        VarDependencies dependencies = new VarDependencies(st);
        Match match = ((Match) sq.clauses.iterator().next());
        Iterator<PatternPart> iter = this.getPatternPart(match);
        List<Relationship> match0 = dependencies.getRelationships(this.genClauseForASTNode(iter.next()));
        Assert.assertEquals(match0.size(), 1);
        Assert.assertEquals(match0.get(0).leftNode.name, "a");
        Assert.assertEquals(match0.get(0).rightNode.name, "b");
    }

}