Aggregate implements Expression { public void visit(ExpressionVisitor visitor) { visitor.visit(this); } Aggregate(Class<T> type,
                   Foldable<T> function,
                   List<Expression> expressions); void visit(ExpressionVisitor visitor); Class<T> typeConstraint(); Iterable<Expression> children(); int compareTo(Expression e); boolean equals(Object o); int hashCode(); final Class<T> type; final Foldable<T> function; final List<Expression> expressions; final int order; }
@Test public void visitVisits() { ExpressionVisitor visitor = mock(ExpressionVisitor.class); agg.visit(visitor); verify(visitor).visit(agg); }
@Test public void allExpressionsVisited() { verify(exp1).visit(any(ExpressionVisitor.class)); verify(exp2).visit(any(ExpressionVisitor.class)); }