@Test
public void testGetUsedAndIndirectUsedVars1() {

    String cypher = "" +
            "MATCH (a)--(b)\n" +
            "MATCH (b)--(c)\n" +
            "MATCH (a)--(d)\n" +
            "RETURN 42";
    Statement st = PassAvailables.parseCypher(cypher);
    SingleQuery sq = (SingleQuery) st.query.part;
    VarDependencies dependencies = new VarDependencies(st);
    Iterator<Clause> clauses = sq.clauses.iterator();
    List<Var> match0 = dependencies.getUsedAndIndirectUsedVars(
            this.genClauseForASTNode(this.getPatternPart(clauses.next()).next()));
    List<Var> match1 = dependencies.getUsedAndIndirectUsedVars(
            this.genClauseForASTNode(this.getPatternPart(clauses.next()).next()));
    List<Var> match2 = dependencies.getUsedAndIndirectUsedVars(
            this.genClauseForASTNode(this.getPatternPart(clauses.next()).next()));
    Assert.assertEquals(match0.size(), 2);
    Assert.assertEquals(match1.size(), 3);
    Assert.assertEquals(match2.size(), 4);
}