PsiField (final PsiExpression argument) { if (argument instanceof PsiReferenceExpression ref && ref.resolve() instanceof PsiField field) { final PsiModifierList modifierList = field.getModifierList(); if (modifierList != null && modifierList.hasModifierProperty(PsiModifier.FINAL)) { return field; } } return null; }