void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (element instanceof PsiLambdaExpression lambda) { MethodReferenceCandidate methodReferenceCandidate = extractMethodReferenceCandidateExpression(lambda.getBody()); if (methodReferenceCandidate == null) return; element = methodReferenceCandidate.myExpression; } final PsiLambdaExpression lambdaExpression = PsiTreeUtil.getParentOfType(element, PsiLambdaExpression.class); if (lambdaExpression == null) return; tryConvertToMethodReference(lambdaExpression, element); }