PsiExpression (PsiElement body) { if (body instanceof PsiCodeBlock) { PsiExpression psiExpression = LambdaUtil.extractSingleExpressionFromBody(body); if (psiExpression != null && !findCommentsOutsideExpression(body, psiExpression)) { if (LambdaUtil.isExpressionStatementExpression(psiExpression) && !LambdaUtil.isSafeLambdaBodyReplacement((PsiLambdaExpression)body.getParent(), () -> psiExpression)) { return null; } return psiExpression; } } return null; }