Set<Module> (String packageName) { Set<Module> result = new HashSet<>(); final SourceScope sourceScope = getSourceScope(); final Project project = getConfiguration().getProject(); if (sourceScope != null && packageName != null && JUnitStarter.JUNIT5_PARAMETER.equals(getRunner())) { final PsiPackage aPackage = JavaPsiFacade.getInstance(getConfiguration().getProject()).findPackage(packageName); if (aPackage != null) { final TestSearchScope scope = getScope(); if (scope != null) { final GlobalSearchScope configurationSearchScope = GlobalSearchScopesCore.projectTestScope(project) .intersectWith(sourceScope.getGlobalSearchScope()); final PsiDirectory[] directories = aPackage.getDirectories(configurationSearchScope); for (PsiDirectory directory : directories) { ContainerUtil.addIfNotNull(result, ModuleUtilCore.findModuleForFile(directory.getVirtualFile(), project)); } } } } return result; }