@Test public void testVisitCommunitySetUnion() { CommunitySetUnion csu = CommunitySetUnion.of( new LiteralCommunitySet(CommunitySet.of(StandardCommunity.parse("20:30"))), new LiteralCommunitySet(CommunitySet.of(StandardCommunity.parse("21:30")))); BDD result = _communitySetExprToBDD.visitCommunitySetUnion(csu, _arg); CommunityVar cvar1 = CommunityVar.from(StandardCommunity.parse("20:30")); CommunityVar cvar2 = CommunityVar.from(StandardCommunity.parse("21:30")); assertEquals(cvarToBDD(cvar1).or(cvarToBDD(cvar2)), result); }
@Override public BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg) { return BDDRoute.factory.orAll( communitySetUnion.getExprs().stream() .map(expr -> expr.accept(this, arg)) .collect(Collectors.toList())); }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg) { return BDDRoute.factory.orAll( communitySetUnion.getExprs().stream() .map(expr -> expr.accept(this, arg)) .collect(Collectors.toList())); } }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg) { return BDDRoute.factory.orAll( communitySetUnion.getExprs().stream() .map(expr -> expr.accept(this, arg)) .collect(Collectors.toList())); }  }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg) { return BDDRoute.factory.orAll( communitySetUnion.getExprs().stream() .map(expr -> expr.accept(this, arg)) .collect(Collectors.toList())); }  @Override BDD visitCommunityExprsSet(CommunityExprsSet communityExprsSet, Arg arg); @Override BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg); @Override BDD visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Arg arg); @Override BDD visitCommunitySetReference(CommunitySetReference communitySetReference, Arg arg); @Override BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg); @Override BDD visitInputCommunities(InputCommunities inputCommunities, Arg arg); @Override BDD visitLiteralCommunitySet(LiteralCommunitySet literalCommunitySet, Arg arg); }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg) { return BDDRoute.factory.orAll( communitySetUnion.getExprs().stream() .map(expr -> expr.accept(this, arg)) .collect(Collectors.toList())); }  @Override BDD visitCommunityExprsSet(CommunityExprsSet communityExprsSet, Arg arg); @Override BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg); @Override BDD visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Arg arg); @Override BDD visitCommunitySetReference(CommunitySetReference communitySetReference, Arg arg); @Override BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg); @Override BDD visitInputCommunities(InputCommunities inputCommunities, Arg arg); @Override BDD visitLiteralCommunitySet(LiteralCommunitySet literalCommunitySet, Arg arg);  }