Neo4JDbFeatureExecutor extends AbstractDbFeatureExecutor<Graph<Node, Edge>, Connection> { @Override protected DbFeature<Connection> createCleanupFeature(final CleanupStrategy cleanupStrategy, final List<Graph<Node, Edge>> initialDataSets) { return (final Connection connection) -> { final CleanupStrategyExecutor<Connection, Graph<Node, Edge>> executor = cleanupStrategy .provide(new CleanupStrategyProvider(graphElementFactory)); executor.execute(connection, initialDataSets); }; } protected  Neo4JDbFeatureExecutor(final FeatureResolver featureResolver, final List<Class<?>> entityClasses);   }
@SuppressWarnings("unchecked") @Test public void testCleanupFeatureExecution() throws DbFeatureException { when(cleanupStrategy.provide(any(CleanupStrategy.StrategyProvider.class))).thenReturn(cleanupStrategyExecutor); final List<Graph<Node, Edge>> initialDataSets = Arrays.asList(new DefaultDirectedGraph<>(new ClassBasedEdgeFactory<>(Edge.class))); final DbFeature<Connection> feature = featureExecutor.createCleanupFeature(cleanupStrategy, initialDataSets); assertThat(feature, notNullValue()); feature.execute(connection); verify(cleanupStrategyExecutor).execute(eq(connection), eq(initialDataSets)); }