PsiAnnotation (@NotNull PsiModifierListOwner owner) { if (owner instanceof PsiMethod && IMMUTABLE_FACTORY.methodMatches((PsiMethod)owner)) { return Mutability.UNMODIFIABLE.asAnnotation(myProject); } if (!(owner instanceof PsiMethodImpl method)) return null; PsiModifierList modifiers = method.getModifierList(); if (modifiers.hasAnnotation(Mutability.UNMODIFIABLE_ANNOTATION) || modifiers.hasAnnotation(Mutability.UNMODIFIABLE_VIEW_ANNOTATION)) { return null; } return JavaSourceInference.inferMutability(method).asAnnotation(myProject); }