@Test
public void accept() throws Exception {

  BinaryExpr be = new BinaryExpr(new IntConstantExpr("1"),
      new IntConstantExpr("1"), BinOp.ADD);
  BinaryExpr theExpr = new BinaryExpr(be.clone(), be.clone(), BinOp.ADD);
  theExpr = new BinaryExpr(theExpr.clone(), theExpr.clone(), BinOp.ADD);
  int numBinariesInExpr =
      new StandardVisitor() {
        private int numBinaries;
        @Override
        public void visitBinaryExpr(BinaryExpr binaryExpr) {
          super.visitBinaryExpr(binaryExpr);
          numBinaries++;
        }
        int getNumBinaries(Expr e) {
          numBinaries = 0;
          visit(e);
          return numBinaries;
        }
      }.getNumBinaries(theExpr);
  assertEquals(7, numBinariesInExpr);
}