@Test
public void replaceChild() {

  final ExprStmt init = new ExprStmt(new IntConstantExpr("0"));
  final IntConstantExpr condition = new IntConstantExpr("1");
  final IntConstantExpr increment = new IntConstantExpr("2");
  final BlockStmt body = new BlockStmt(new ArrayList<>(), false);
  final ForStmt forStmt = new ForStmt(
      init,
      condition,
      increment,
      body);
  final ExprStmt newInit = new ExprStmt(new IntConstantExpr("3"));
  final IntConstantExpr newCondition = new IntConstantExpr("4");
  final IntConstantExpr newIncrement = new IntConstantExpr("5");
  final BlockStmt newBody = new BlockStmt(new ArrayList<>(), false);
  forStmt.replaceChild(init, newInit);
  forStmt.replaceChild(condition, newCondition);
  forStmt.replaceChild(increment, newIncrement);
  forStmt.replaceChild(body, newBody);
  assertTrue(newInit == forStmt.getInit());
  assertTrue(newCondition == forStmt.getCondition());
  assertTrue(newIncrement == forStmt.getIncrement());
  assertTrue(newBody == forStmt.getBody());
}