boolean (PsiModifierListOwner listOwner, String visibility) { if (visibility != null) { while (listOwner != null) { if (VisibilityUtil.compare(VisibilityUtil.getVisibilityModifier(listOwner.getModifierList()), visibility) >= 0) { return true; } listOwner = PsiTreeUtil.getParentOfType(listOwner, PsiModifierListOwner.class, true); } } return false; }