@Override
  protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException {
    PsiElement from = JavaAnonymousUnwrapper.findElementToExtractFrom(element);
    PsiLambdaExpression lambdaExpression = (PsiLambdaExpression)element;
    PsiElement body = lambdaExpression.getBody();
    if (body instanceof PsiExpression || body instanceof PsiCodeBlock && ((PsiCodeBlock)body).getStatementCount() == 1) {
      List<PsiExpression> returnExpressions = LambdaUtil.getReturnExpressions(lambdaExpression);
      if (returnExpressions.size() == 1
          && !PsiTypes.voidType().equals(returnExpressions.get(0).getType())
          && JavaAnonymousUnwrapper.toAssignment(context, from, returnExpressions.get(0))) {
        return;
      }
    }

    if (body instanceof PsiCodeBlock) {
      if (from.getParent() instanceof PsiLambdaExpression) {
        context.extractElement(body, from);
      }
      else {
        context.extractFromCodeBlock((PsiCodeBlock)body, from);
      }
    }
    else {
      context.extractElement(body, from);
      if (context.isEffective() && !(from.getParent() instanceof PsiLambdaExpression)) {
        PsiStatement emptyStatement = JavaPsiFacade.getElementFactory(from.getProject()).createStatementFromText(";", from);
        from.getParent().addBefore(emptyStatement, from);
      }
    }
    context.deleteExactly(from);
  }
@Override
  protected void doUnwrap(PsiElement element, Context context)