@Test
public void testReplaceChild() throws Exception {

  final String before = "void main() {"
        + "  switch(0) {"
        + "    case 1:"
        + "      return;"
        + "    default:"
        + "      break;"
        + "  }"
        + "}";
  final String after = "void main() {"
        + "  switch(0) {"
        + "    case 2:"
        + "      return;"
        + "    default:"
        + "      break;"
        + "  }"
        + "}";
  final TranslationUnit tu = ParseHelper.parse(before);
  new StandardVisitor() {
    @Override
    public void visitExprCaseLabel(ExprCaseLabel exprCaseLabel) {
      super.visitExprCaseLabel(exprCaseLabel);
      exprCaseLabel.replaceChild(exprCaseLabel.getExpr(), new IntConstantExpr("2"));
    }
  }.visit(tu);
  CompareAstsDuplicate.assertEqualAsts(after, tu);
}