@Test public void testVisitCommunitySetDifference() { CommunitySetDifference csd = new CommunitySetDifference( new LiteralCommunitySet( CommunitySet.of( StandardCommunity.parse("20:30"), StandardCommunity.parse("21:30"))), new CommunityMatchRegex(ColonSeparatedRendering.instance(), "^20:")); BDD result = _communitySetExprToBDD.visitCommunitySetDifference(csd, _arg); CommunityVar cvar1 = CommunityVar.from(StandardCommunity.parse("21:30")); CommunityVar cvar2 = CommunityVar.from("^20:"); assertEquals(cvarToBDD(cvar1).diff(cvarToBDD(cvar2)), result); }
@Override public BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg) { BDD positive = communitySetDifference.getInitial().accept(this, arg); BDD negative = communitySetDifference.getRemovalCriterion().accept(new CommunityMatchExprToBDD(), arg); return positive.diffWith(negative); }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg) { BDD positive = communitySetDifference.getInitial().accept(this, arg); BDD negative = communitySetDifference.getRemovalCriterion().accept(new CommunityMatchExprToBDD(), arg); return positive.diffWith(negative); } }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg) { BDD positive = communitySetDifference.getInitial().accept(this, arg); BDD negative = communitySetDifference.getRemovalCriterion().accept(new CommunityMatchExprToBDD(), arg); return positive.diffWith(negative); }  }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg) { BDD positive = communitySetDifference.getInitial().accept(this, arg); BDD negative = communitySetDifference.getRemovalCriterion().accept(new CommunityMatchExprToBDD(), arg); return positive.diffWith(negative); }  @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 visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg) { BDD positive = communitySetDifference.getInitial().accept(this, arg); BDD negative = communitySetDifference.getRemovalCriterion().accept(new CommunityMatchExprToBDD(), arg); return positive.diffWith(negative); }  @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);  }