void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiMethodReferenceExpression methodRef = ObjectUtils.tryCast(element, PsiMethodReferenceExpression.class); if (methodRef == null) return; PsiLambdaExpression lambdaExpression = LambdaRefactoringUtil.convertMethodReferenceToLambda(methodRef, true, true); if (lambdaExpression == null) return; PsiElement body = lambdaExpression.getBody(); if (body == null) return; body.replace(JavaPsiFacade.getElementFactory(project).createExpressionFromText(myValue, lambdaExpression)); }