@Test public void testVisitCommunitySetReference() { CommunitySet cs = CommunitySet.of(StandardCommunity.of(1L)); CommunityContext ctx = CommunityContext.builder().setCommunitySets(ImmutableMap.of("defined", cs)).build(); assertThat( new CommunitySetReference("defined").accept(CommunitySetExprEvaluator.instance(), ctx), equalTo(cs)); }
@Override public @Nonnull CommunitySet visitCommunitySetReference( CommunitySetReference communitySetReference, CommunityContext arg) { CommunitySet communitySet = arg.getCommunitySets().get(communitySetReference.getName()); assert communitySet != null; return communitySet; }
CommunitySetExprEvaluator implements CommunitySetExprVisitor<CommunitySet, CommunityContext> { @Override public @Nonnull CommunitySet visitCommunitySetReference( CommunitySetReference communitySetReference, CommunityContext arg) { CommunitySet communitySet = arg.getCommunitySets().get(communitySetReference.getName()); assert communitySet != null; return communitySet; } }
CommunitySetExprEvaluator implements CommunitySetExprVisitor<CommunitySet, CommunityContext> { @Override public @Nonnull CommunitySet visitCommunitySetReference( CommunitySetReference communitySetReference, CommunityContext arg) { CommunitySet communitySet = arg.getCommunitySets().get(communitySetReference.getName()); assert communitySet != null; return communitySet; } private  CommunitySetExprEvaluator(); }
CommunitySetExprEvaluator implements CommunitySetExprVisitor<CommunitySet, CommunityContext> { @Override public @Nonnull CommunitySet visitCommunitySetReference( CommunitySetReference communitySetReference, CommunityContext arg) { CommunitySet communitySet = arg.getCommunitySets().get(communitySetReference.getName()); assert communitySet != null; return communitySet; } private  CommunitySetExprEvaluator(); static @Nonnull CommunitySetExprEvaluator instance(); @Override @Nonnull CommunitySet visitInputCommunities(
      InputCommunities inputCommunities, CommunityContext arg); @Override CommunitySet visitCommunityExprsSet(
      CommunityExprsSet communityExprsSet, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetDifference(
      CommunitySetDifference communitySetDifference, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetReference(
      CommunitySetReference communitySetReference, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetUnion(
      CommunitySetUnion communitySetUnion, CommunityContext arg); @Override @Nonnull CommunitySet visitLiteralCommunitySet(
      LiteralCommunitySet literalCommunitySet, CommunityContext arg); }
CommunitySetExprEvaluator implements CommunitySetExprVisitor<CommunitySet, CommunityContext> { @Override public @Nonnull CommunitySet visitCommunitySetReference( CommunitySetReference communitySetReference, CommunityContext arg) { CommunitySet communitySet = arg.getCommunitySets().get(communitySetReference.getName()); assert communitySet != null; return communitySet; } private  CommunitySetExprEvaluator(); static @Nonnull CommunitySetExprEvaluator instance(); @Override @Nonnull CommunitySet visitInputCommunities(
      InputCommunities inputCommunities, CommunityContext arg); @Override CommunitySet visitCommunityExprsSet(
      CommunityExprsSet communityExprsSet, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetDifference(
      CommunitySetDifference communitySetDifference, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetReference(
      CommunitySetReference communitySetReference, CommunityContext arg); @Override @Nonnull CommunitySet visitCommunitySetUnion(
      CommunitySetUnion communitySetUnion, CommunityContext arg); @Override @Nonnull CommunitySet visitLiteralCommunitySet(
      LiteralCommunitySet literalCommunitySet, CommunityContext arg);  }