@Test
    @Ignore
    @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
    public void benchmarkCypherAndMatch() throws Exception {
        final Neo4jGraph n = (Neo4jGraph) graph;
        final List<Supplier<GraphTraversal<?, ?>>> traversals = Arrays.asList(
                () -> g.V().match(
                        as("a").in("sungBy").as("b"),
                        as("a").in("writtenBy").as("b")).select("a", "b").by("name"),
                () -> n.cypher("MATCH (a)<-[:sungBy]-(b), (a)<-[:writtenBy]-(b) RETURN a.name, b.name"),
                ///
                () -> g.V().match(
                        as("a").out("followedBy").as("b"),
                        as("b").out("followedBy").as("a")).select("a", "b").by("name"),
                () -> n.cypher("MATCH (a)-[:followedBy]->(b), (b)-[:followedBy]->(a) RETURN a.name, b.name"),
                ///
                () -> g.V().match(
                        as("a").out("followedBy").count().is(P.gt(10)).as("b"),
                        as("a").in("followedBy").count().is(P.gt(10)).as("b")).
                        select("a").by("name"),
                () -> n.cypher("MATCH (a)-[:followedBy]->(b) WITH a, COUNT(b) AS bc WHERE bc > 10 MATCH (a)<-[:followedBy]-(c) WITH a, bc, COUNT(c) AS cc WHERE bc = cc RETURN a.name"),
                ///
                () -> g.V().match(
                        as("a").in("sungBy").count().as("b"),
                        as("a").in("sungBy").as("c"),
                        as("c").out("followedBy").as("d"),
                        as("d").out("sungBy").as("e"),
                        as("e").in("sungBy").count().as("b"),
                        where("a", P.neq("e"))).select("a", "e").by("name"),
                () -> n.cypher("MATCH (a)<-[:sungBy]-()-[:followedBy]->()-[:sungBy]->(e) WHERE a <> e WITH a, e MATCH (a)<-[:sungBy]-(b) WITH a, e, COUNT(DISTINCT b) as bc MATCH (e)<-[:sungBy]-(f) WITH a, e, bc, COUNT(DISTINCT f) as fc WHERE bc = fc RETURN a.name, e.name"),
                ///
                () -> g.V().match(
                        as("a").in("followedBy").as("b"),
                        as("a").out("sungBy").as("c"),
                        as("b").out("sungBy").as("c")).select("a", "b"),
                () -> n.cypher("MATCH (a)<-[:followedBy]-(b), (a)-[:sungBy]->(c), (b)-[:sungBy]->(c) RETURN a, b"),
                ///
                () -> g.V().match(
                        as("a").in("followedBy").as("b"),
                        as("a").out("sungBy").as("c"),
                        as("a").out("writtenBy").as("d"),
                        as("b").out("sungBy").as("c"),
                        as("b").out("writtenBy").as("d"),
                        where("c", P.neq("d"))).select("a", "b").by("name"),
                () -> n.cypher("MATCH (a)<-[:followedBy]-(b), (a)-[:sungBy]->(c), (a)-[:writtenBy]->(d), (b)-[:sungBy]->(c), (b)-[:writtenBy]->(d) WHERE c <> d RETURN a.name, b.name"),
                ///
                () -> g.V().match(
                        as("a").in("sungBy").as("b"),
                        as("a").in("writtenBy").as("b"),
                        as("b").out("followedBy").as("c"),
                        as("c").out("sungBy").as("a"),
                        as("c").out("writtenBy").as("a")).select("a").by("name"),
                () -> n.cypher("MATCH (a)<-[:sungBy]-(b), (a)<-[:writtenBy]-(b), (b)-[:followedBy]->(c), (c)-[:sungBy]->(a), (c)-[:writtenBy]->(a) RETURN a.name"),
                ///
                () -> g.V().match(
                        as("a").has("name", "Garcia").has(T.label, "artist"),
                        as("a").in("writtenBy").as("b"),
                        as("b").out("followedBy").as("c"),
                        as("c").out("writtenBy").as("d"),
                        as("d").where(P.neq("a"))).select("a", "d").by("name"),
                () -> n.cypher("MATCH (a)<-[:writtenBy]-(b), (b)-[:followedBy]->(c), (c)-[:writtenBy]->(d) WHERE a <> d AND a.name = 'Garcia' AND 'artist' IN labels(a) RETURN a.name, d.name"),
                ///
                () -> g.V().match(
                        as("a").out("followedBy").as("b"),
                        as("b").out("followedBy").as("c")).select("a").by("name"),
                () -> n.cypher("MATCH (a)-[:followedBy]->(b), (b)-[:followedBy]->(c) RETURN a.name"),
                ///
                () -> g.V().match(
                        as("a").out("followedBy").as("b"),
                        as("a").has(T.label, "song").has("performances", P.gt(10)),
                        as("a").out("writtenBy").as("c"),
                        as("b").out("writtenBy").as("c")).select("a", "b", "c").by("name"),
                () -> n.cypher("MATCH (a)-[:followedBy]->(b), (a)-[:writtenBy]->(c), (b)-[:writtenBy]->(c) WHERE a.performances > 10 AND 'song' IN labels(a) RETURN a, b, c").select("a", "b", "c").by("name")
        );

        for (int i = 0; i < traversals.size(); i = i + 2) {
            final Supplier<GraphTraversal<?, ?>> gremlin = traversals.get(i);
            final Supplier<GraphTraversal<?, ?>> cypher = traversals.get(i + 1);
            for (final Supplier<GraphTraversal<?, ?>> sub : Arrays.asList(cypher, gremlin)) {
                logger.info("pre-strategy:  {}", sub.get());
                logger.info("post-strategy: {}", sub.get().iterate());
                logger.info(TimeUtil.clockWithResult(25, () -> sub.get().count().next()).toString());
                logger.info("------------------");
            }
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
@author Stephen Mallette (http://stephen.genoprime.com)
neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NativeNeo4jCypherCheck.java