@Test
public void accept() throws Exception {

  TernaryExpr te = new TernaryExpr(
      makeTernary().clone(),
      makeTernary().clone(),
      makeTernary().clone());
  assertEquals(4,
      new StandardVisitor() {
        private int numTernaries;
        @Override
        public void visitTernaryExpr(TernaryExpr ternaryExpr) {
          super.visitTernaryExpr(ternaryExpr);
          numTernaries++;
        }
        public int getNumTernaries(TernaryExpr node) {
          numTernaries = 0;
          visit(node);
          return numTernaries;
        }
      }.getNumTernaries(te)
  );
}