void (@NotNull PsiMethodCallExpression call) { PsiElement nameElement = call.getMethodExpression().getReferenceNameElement(); if (nameElement == null) return; if (!OptionalUtil.OPTIONAL_GET.test(call)) return; PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(call.getMethodExpression().getQualifierExpression()); if (qualifier == null) return; PsiClass optionalClass = PsiUtil.resolveClassInClassTypeOnly(qualifier.getType()); if (optionalClass == null) return; JavaExpressionAnchor anchor = new JavaExpressionAnchor(qualifier); if (isOptionalProblem(qualifier, anchor) && !isPresentCallWithSameQualifierExists(qualifier)) { holder.registerProblem(nameElement, JavaBundle.message("inspection.optional.get.without.is.present.message", optionalClass.getName()), LocalQuickFix.notNullElements(tryCreateFix(call))); } }