LocalQuickFix (@NotNull PsiExpression qualifier) { final PsiMethodCallExpression call = findCallExpression(qualifier); final PsiMethod method = call == null ? null : call.resolveMethod(); final PsiClass containingClass = method == null ? null : method.getContainingClass(); if (containingClass != null && "of".equals(method.getName())) { final String qualifiedName = containingClass.getQualifiedName(); if (CommonClassNames.JAVA_UTIL_OPTIONAL.equals(qualifiedName)) { return new ReplaceOptionalCallFix("ofNullable", false); } if (OptionalUtil.GUAVA_OPTIONAL.equals(qualifiedName)) { return new ReplaceOptionalCallFix("fromNullable", false); } } return null; }