And extends BaseExpression { @Override public void addChildren(Deque<Expression> expressions) { addChildren(expressions, 2); } And(); static void registerExpression(ExpressionFactory factory); @Override Result apply(PathData item, int depth); @Override boolean isOperator(); @Override int getPrecedence(); @Override void addChildren(Deque<Expression> expressions);  }
@Test public void testSetOptions() throws IOException { And and = new And(); Expression first = mock(Expression.class); Expression second = mock(Expression.class); Deque<Expression> children = new LinkedList<Expression>(); children.add(second); children.add(first); and.addChildren(children); FindOptions options = mock(FindOptions.class); and.setOptions(options); verify(first).setOptions(options); verify(second).setOptions(options); verifyNoMoreInteractions(first); verifyNoMoreInteractions(second); }
@Test public void testPrepare() throws IOException { And and = new And(); Expression first = mock(Expression.class); Expression second = mock(Expression.class); Deque<Expression> children = new LinkedList<Expression>(); children.add(second); children.add(first); and.addChildren(children); and.prepare(); verify(first).prepare(); verify(second).prepare(); verifyNoMoreInteractions(first); verifyNoMoreInteractions(second); }
@Test public void testFinish() throws IOException { And and = new And(); Expression first = mock(Expression.class); Expression second = mock(Expression.class); Deque<Expression> children = new LinkedList<Expression>(); children.add(second); children.add(first); and.addChildren(children); and.finish(); verify(first).finish(); verify(second).finish(); verifyNoMoreInteractions(first); verifyNoMoreInteractions(second); }