### Question:
LambdaCaptureDesugaringRewriter { public static Expression rewrite(Expression expression, TypeProvider symbolTypes, SymbolAllocator symbolAllocator) { return ExpressionTreeRewriter.rewriteWith(new Visitor(symbolTypes, symbolAllocator), expression, new Context()); } private  LambdaCaptureDesugaringRewriter(); static Expression rewrite(Expression expression, TypeProvider symbolTypes, SymbolAllocator symbolAllocator);  }### Answer:
@Test public void testRewriteBasicLambda() { Map<Symbol, Type> symbols = ImmutableMap.of(new Symbol("a"), BigintType.BIGINT); SymbolAllocator allocator = new SymbolAllocator(symbols); assertEquals(rewrite(expression("x -> a + x"), allocator.getTypes(), allocator), new BindExpression( ImmutableList.of(expression("a")), new LambdaExpression( Stream.of("a_0", "x") .map(Identifier::new) .map(LambdaArgumentDeclaration::new) .collect(toList()), expression("a_0 + x")))); }