### Question:
DeleteAllOperation extends AbstractNeo4JOperation { @Override public void execute(final Connection connection, final Graph<Node, Edge> graph) throws SQLException { for (final Node node : graph.vertexSet()) { final StartNext match = match(node.toPath().withId("n").build()); executeQuery(connection, match.toString() + " DETACH DELETE n"); } }  @Override void execute(final Connection connection, final Graph<Node, Edge> graph);  }### Answer:
@Test public void testExecute() throws Exception { final Node n1 = graphElementFactory.createNode("n1", Arrays.asList("A"), ImmutableMap.<String, Object>builder().put("id", 1l).build()); final Node n2 = graphElementFactory.createNode("n2", Arrays.asList("A"), ImmutableMap.<String, Object>builder().put("id", 2l).build()); final Edge e1 = graphElementFactory.createEdge(n1, n2, "e1", Arrays.asList("E"), Collections.emptyMap()); final Graph<Node, Edge> graph = new DefaultDirectedGraph<>(new ClassBasedEdgeFactory<>(Edge.class)); graph.addVertex(n1); graph.addVertex(n2); graph.addEdge(e1.getSourceNode(), e1.getTargetNode(), e1); operation.execute(connection, graph); final ArgumentCaptor<String> queryCaptor = ArgumentCaptor.forClass(String.class); verify(operation, times(2)).executeQuery(eq(connection), queryCaptor.capture()); final String query = queryCaptor.getValue(); assertThat(query, containsString("MATCH (n:A) DETACH DELETE n")); }