boolean (@NotNull PsiPackage aPackage, @Nullable Module module, boolean strictlyEmpty, final boolean inLibrary) { final Project project = aPackage.getProject(); final GlobalSearchScope scopeToShow = getScopeToShow(project, module, inLibrary); PsiElement[] children = aPackage.getFiles(scopeToShow); if (children.length > 0) { return false; } PsiPackage[] subPackages = aPackage.getSubPackages(scopeToShow); if (strictlyEmpty) { return subPackages.length == 1; } return subPackages.length > 0; }