@Test
public void testReachableVarsInOrderBy() {

    String cypher = "" +
            "MATCH (a)\n" +
            "WITH a.firstName AS foo ORDER BY foo\n" +
            "RETURN foo";
    Statement st = PassAvailables.parseCypher(cypher);
    SingleQuery sq = (SingleQuery) st.query.part;
    VarDependencies deps = new VarDependencies(st);
    With with = (With) sq.clauses.get(1);
    AvailableVariables orderBy = deps.getReachableVars(new ClauseId(with.orderBy.get()));
    Assert.assertTrue(orderBy.get("foo").isPresent());
}