boolean (PsiExpression expression) { return PsiTreeUtil.processElements(expression, e -> { if (e instanceof PsiCallExpression) return false; if (e instanceof PsiReferenceExpression ref && ref.resolve() instanceof PsiField field) { return field.hasModifierProperty(PsiModifier.FINAL); } return !(e instanceof PsiArrayAccessExpression); }); }