@Test
public void apply() throws Exception {

  final ExprStmt toOutline = new ExprStmt(new BinaryExpr(
      new VariableIdentifierExpr("x"),
      new BinaryExpr(new BinaryExpr(new VariableIdentifierExpr("x"),
          new VariableIdentifierExpr("y"), BinOp.MUL), new VariableIdentifierExpr("z"),
          BinOp.ADD), BinOp.ASSIGN));
  final Scope fakeScope = new Scope();
  fakeScope.add("x", BasicType.VEC2, Optional.empty());
  fakeScope.add("y", BasicType.FLOAT, Optional.empty());
  fakeScope.add("z", BasicType.VEC2, Optional.empty());
  new OutlineStatementMutation(toOutline, fakeScope, tu, fakeFunction, new IdGenerator()).apply();
  final String expectedDecl = "vec2 " + Constants.OUTLINED_FUNCTION_PREFIX
      + "0(vec2 x, float y, vec2 z)\n"
      + "{\n"
      + PrettyPrinterVisitor.defaultIndent(1) + "return x * y + z;\n"
      + "}\n";
  assertEquals(expectedDecl, tu.getTopLevelDeclarations().get(0).getText());
  assertEquals("x = " + Constants.OUTLINED_FUNCTION_PREFIX + "0(x, y, z);\n",
      toOutline.getText());
}