@Test public void testVisitLongMatchAll() { assertTrue(LongMatchAll.of().accept(LongMatchExprEvaluator.instance(), new LiteralLong(1))); assertTrue( LongMatchAll.of( new LongComparison(IntComparator.EQ, new LiteralLong(1L)), new LongComparison(IntComparator.EQ, new LiteralLong(1L))) .accept(LongMatchExprEvaluator.instance(), new LiteralLong(1L))); assertFalse( LongMatchAll.of( new LongComparison(IntComparator.EQ, new LiteralLong(1L)), new LongComparison(IntComparator.EQ, new LiteralLong(2L))) .accept(LongMatchExprEvaluator.instance(), new LiteralLong(1L))); }
@Override public @Nonnull Boolean visitLongMatchAll(LongMatchAll longMatchAll, LongExpr arg) { return longMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }
LongMatchExprEvaluator implements LongMatchExprVisitor<Boolean, LongExpr> { @Override public @Nonnull Boolean visitLongMatchAll(LongMatchAll longMatchAll, LongExpr arg) { return longMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); } }
LongMatchExprEvaluator implements LongMatchExprVisitor<Boolean, LongExpr> { @Override public @Nonnull Boolean visitLongMatchAll(LongMatchAll longMatchAll, LongExpr arg) { return longMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }  }
LongMatchExprEvaluator implements LongMatchExprVisitor<Boolean, LongExpr> { @Override public @Nonnull Boolean visitLongMatchAll(LongMatchAll longMatchAll, LongExpr arg) { return longMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }  static @Nonnull LongMatchExprEvaluator instance(); @Override @Nonnull Boolean visitLongComparison(LongComparison longComparison, LongExpr arg); @Override @Nonnull Boolean visitLongMatchAll(LongMatchAll longMatchAll, LongExpr arg); }
LongMatchExprEvaluator implements LongMatchExprVisitor<Boolean, LongExpr> { @Override public @Nonnull Boolean visitLongMatchAll(LongMatchAll longMatchAll, LongExpr arg) { return longMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }  static @Nonnull LongMatchExprEvaluator instance(); @Override @Nonnull Boolean visitLongComparison(LongComparison longComparison, LongExpr arg); @Override @Nonnull Boolean visitLongMatchAll(LongMatchAll longMatchAll, LongExpr arg);  }