GlobalSearchScope (Project project) { Module[] modules = Arrays.stream(mySuites).filter(suite -> suite instanceof BaseCoverageSuite) .map(suite -> ((BaseCoverageSuite)suite).getConfiguration()) .filter(configuration -> configuration instanceof ModuleBasedConfiguration) .map(configuration -> ((ModuleBasedConfiguration<?, ?>)configuration).getConfigurationModule().getModule()) .toArray(Module[]::new); if (modules.length == 0 || ArrayUtil.find(modules, null) > -1) { return isTrackTestFolders() ? GlobalSearchScope.projectScope(project) : GlobalSearchScopesCore.projectProductionScope(project); } return GlobalSearchScope.union(Arrays.stream(modules).map(module -> GlobalSearchScope.moduleRuntimeScope(module, isTrackTestFolders())).toArray(GlobalSearchScope[]::new)); }