RefinerMatchResult (@NotNull PsiElement element) { if (!(element instanceof PsiIdentifier)) return null; if (myMethodName != null && !element.textMatches(myMethodName)) return null; PsiElement parent = element.getParent(); if (!(parent instanceof PsiReferenceExpression)) return null; PsiMethodCallExpression call = ObjectUtils.tryCast(parent.getParent(), PsiMethodCallExpression.class); if (call == null) return null; PsiMethod target = call.resolveMethod(); if (target == null) return null; if (LambdaUtil.getFunctionalInterfaceMethod(target.getContainingClass()) != target) return null; return RefinerMatchResult.of(element); }