boolean (@NotNull PsiField field) { if (!field.hasModifierProperty(PsiModifier.FINAL)) { return false; } final PsiExpression initializer = PsiUtil.skipParenthesizedExprDown(field.getInitializer()); if (ExpressionUtils.isNullLiteral(initializer)) { return true; } if (!(initializer instanceof PsiMethodCallExpression methodCallExpression)) { return false; } final PsiMethod method = methodCallExpression.resolveMethod(); if (method == null || myMethodMatcher.matches(method)) { return true; } if (ExpressionUtils.hasExpressionCount(methodCallExpression.getArgumentList(), 0) && "asList".equals(method.getName())) { final PsiClass containingClass = method.getContainingClass(); if (containingClass != null && CommonClassNames.JAVA_UTIL_ARRAYS.equals(containingClass.getQualifiedName())) { // empty Arrays.asList() is harmless return true; } } final PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(methodCallExpression.getType()); return aClass != null && JCiPUtil.isImmutable(aClass); }