void (Map<CoverageEngine, List<CoverageSuite>> byEngine) { Collection<CoverageSuitesBundle> activeSuites = myCoverageManager.activeSuites(); Set<CoverageEngine> activeEngines = activeSuites.stream().map(b -> b.getCoverageEngine()).collect(Collectors.toSet()); activeEngines.removeAll(byEngine.keySet()); for (CoverageSuitesBundle bundle : activeSuites) { if (activeEngines.contains(bundle.getCoverageEngine())) { myCoverageManager.closeSuitesBundle(bundle); } } }