Collection<PsiJavaModule> (Collection<PsiJavaModule> modules, GlobalSearchScope scope) { if (modules.size() > 1) { List<PsiJavaModule> list = new ArrayList<>(modules); list.sort((m1, m2) -> scope.compare(PsiImplUtil.getModuleVirtualFile(m2), PsiImplUtil.getModuleVirtualFile(m1))); modules = list; } return modules; }