### Question:
SpelNodeInclusionPolicy extends SpelInclusionPolicy implements NodeInclusionPolicy { @Override public Iterable<Node> getAll(GraphDatabaseService database) { if(expressionNode.toStringAST().startsWith("hasLabel")) { String labelName = stripWrappingQuotes(expressionNode.getChild(0).toStringAST()); return () -> database.findNodes(Label.label(labelName)); } return new FilteringIterable<>(database.getAllNodes(), this::include); } SpelNodeInclusionPolicy(String expression); @Override boolean include(Node node); @Override Iterable<Node> getAll(GraphDatabaseService database);  }### Answer:
@Test public void shouldCorrectlyGetAllNodes() { try (Transaction tx = database.beginTx()) { assertEquals(1, Iterables.count(simplePolicy1.getAll(database))); assertEquals(michal(), simplePolicy1.getAll(database).iterator().next()); assertEquals(3, Iterables.count(simplePolicy2.getAll(database))); assertEquals(3, Iterables.count(policy1.getAll(database))); assertEquals(2, Iterables.count(policy2.getAll(database))); assertEquals(1, Iterables.count(policy3.getAll(database))); assertEquals(graphaware(), policy3.getAll(database).iterator().next()); assertEquals(1, Iterables.count(policy4.getAll(database))); assertEquals(graphaware(), policy4.getAll(database).iterator().next()); assertEquals(0, Iterables.count(policy5.getAll(database))); assertEquals(2, Iterables.count(policy6.getAll(database))); assertEquals(2, Iterables.count(policy7.getAll(database))); tx.success(); } }