class CommunitySetExprEvaluator implements CommunitySetExprVisitor<CommunitySet, CommunityContext> {

  @Override
  public @Nonnull CommunitySet visitCommunitySetUnion(
      CommunitySetUnion communitySetUnion, CommunityContext arg) {
    ImmutableSet.Builder<Community> builder = ImmutableSet.builder();
    communitySetUnion
        .getExprs()
        .forEach(expr -> builder.addAll(expr.accept(this, arg).getCommunities()));
    return CommunitySet.of(builder.build());
  }

  private  CommunitySetExprEvaluator();

}