void (List<String> options, @NotNull PsiPackage aPackage, GlobalSearchScope globalSearchScope) { if (aPackage.getClasses(globalSearchScope).length > 0) { options.add(aPackage.getQualifiedName()); } PsiPackage[] subPackages = aPackage.getSubPackages(globalSearchScope); for (PsiPackage subPackage : subPackages) { collectSubPackages(options, subPackage, globalSearchScope); } }