PsiKeyword (@NotNull PsiModifierList modifierList) { for (PsiElement child = modifierList.getFirstChild(); child != null; child = child.getNextSibling()) { if (child instanceof PsiKeyword keyword && AccessModifier.fromKeyword(keyword)!=null) { return keyword; } } return null; }