class CleanupStrategyProvider implements StrategyProvider<CleanupStrategyExecutor<IDatabaseConnection, IDataSet>> {

    @Override
    public CleanupStrategyExecutor<IDatabaseConnection, IDataSet> usedTablesOnlyStrategy() {
        return (final IDatabaseConnection connection, final List<IDataSet> initialDataSets, final String... tablesToExclude) -> {
            if (initialDataSets.isEmpty()) {
                return;
            }

            try {
                IDataSet dataSet = excludeTables(mergeDataSets(initialDataSets), tablesToExclude);
                dataSet = new FilteredDataSet(new DatabaseSequenceFilter(connection), dataSet);
                DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
            } catch (final SQLException | DatabaseUnitException e) {
                throw new DbFeatureException(UNABLE_TO_CLEAN_DATABASE, e);
            }
        };
    }

}