boolean (@NotNull PsiClass psiClass) { if (psiClass.hasModifierProperty(PsiModifier.PUBLIC) || psiClass.hasModifierProperty(PsiModifier.PROTECTED)) { final PsiElement parent = psiClass.getParent(); return parent instanceof PsiJavaFile || parent instanceof PsiClass && isPublicApi((PsiClass)parent); } return false; }