void () { final List<CoverageSuite> suites = collectSelectedSuites(); Map<CoverageEngine, List<CoverageSuite>> byEngine = suites.stream().collect(Collectors.groupingBy((suite) -> suite.getCoverageEngine())); closeBundlesThatAreNotChosen(byEngine); for (List<CoverageSuite> suiteList : byEngine.values()) { CoverageSuitesBundle bundle = new CoverageSuitesBundle(suiteList.toArray(new CoverageSuite[0])); CoverageLogger.logSuiteImport(myProject, bundle); myCoverageManager.chooseSuitesBundle(bundle); } if (!suites.isEmpty()) { ExternalCoverageWatchManager.getInstance(myProject).addRootsToWatch(suites); } super.doOKAction(); }