Cannot iterate over ExecutionResult <p>I have written a test, copying the official cypher query example from <a href="http://docs.neo4j.org/chunked/stable/tutorials-cypher-java.html" rel="nofollow">here</a> and adding a needed cast. Then it fails with: <code>java.lang.ClassCastException: scala.collection.Iterator$$anon$11 cannot be cast to java.util.Iterator ...</code>. This is the code:</p> <pre class="lang-java prettyprint-override"><code>@Test public void testCreateWithCypher() { ExecutionEngine engine = new ExecutionEngine(db, StringLogger.SYSTEM); try (Transaction transaction = db.beginTx()) { String cypher = "CREATE (x:Person {name: 'John'})" + "RETURN x"; ExecutionResult result = engine.execute(cypher); Iterator&lt;Node&gt; n_column = (Iterator&lt;Node&gt;) result.columnAs("x"); for (Node node : IteratorUtil.asIterable(n_column)) { String nodeResult = node + ": " + node.getProperty("name"); } transaction.success(); } } </code></pre> <p>Without the cast, it will not compile, since <code>columnAs</code> returns <code>Iterator&lt;Object&gt;</code>. What is this <code>scala.collection.Iterator$$anon$11</code> doing the by the way? I thought it <a href="http://api.neo4j.org/2.1.0-M01/org/neo4j/graphdb/ResourceIterator.html" rel="nofollow">extended</a> <code>java.lang.Iterator</code>? </p> <p>I just want an <code>Iterator&lt;Node&gt;</code> so that I can get stuff from the <code>ExecutionResult</code>. How can do that without the cast? My project uses these dependencies for <code>${neo4.version}</code> = 2.0.1:</p> <pre class="lang-xml prettyprint-override"><code> &lt;dependency&gt; &lt;groupId&gt;org.neo4j&lt;/groupId&gt; &lt;artifactId&gt;neo4j&lt;/artifactId&gt; &lt;version&gt;${neo4j.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.neo4j&lt;/groupId&gt; &lt;artifactId&gt;neo4j-cypher&lt;/artifactId&gt; &lt;version&gt;${neo4j.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.neo4j&lt;/groupId&gt; &lt;artifactId&gt;neo4j-kernel&lt;/artifactId&gt; &lt;version&gt;${neo4j.version}&lt;/version&gt; &lt;type&gt;test-jar&lt;/type&gt; &lt;/dependency&gt; </code></pre>