void (JavaParameters javaParameters, PsiJavaModule module, boolean includeTests) { Project project = module.getProject(); Set<PsiJavaModule> explicitModules = new LinkedHashSet<>(); explicitModules.add(module); collectExplicitlyAddedModules(project, javaParameters, explicitModules); Set<PsiJavaModule> forModulePath = new HashSet<>(explicitModules); for (PsiJavaModule explicitModule : explicitModules) { forModulePath.addAll(JavaModuleGraphUtil.getAllDependencies(explicitModule)); } if (!includeTests) { putProvidersOnModulePath(project, forModulePath, forModulePath); } JarFileSystem jarFS = JarFileSystem.getInstance(); ProjectFileIndex fileIndex = ProjectFileIndex.getInstance(project); JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); PathsList classPath = javaParameters.getClassPath(); PathsList modulePath = javaParameters.getModulePath(); forModulePath.stream() .filter(javaModule -> !PsiJavaModule.JAVA_BASE.equals(javaModule.getName())) .flatMap(javaModule -> psiFacade.findModules(javaModule.getName(), GlobalSearchScope.allScope(project)).stream()) .map(javaModule -> getClasspathEntry(javaModule, fileIndex, jarFS)) .filter(Objects::nonNull) .forEach(file -> putOnModulePath(modulePath, classPath, file)); VirtualFile productionOutput = getClasspathEntry(module, fileIndex, jarFS); if (productionOutput != null) { putOnModulePath(modulePath, classPath, productionOutput); } }