class BooleanExprVarCollector implements BooleanExprVisitor<Set<CommunityVar>, Configuration> {

  @Override
  public Set<CommunityVar> visitMatchCommunities(
      MatchCommunities matchCommunities, Configuration arg) {
    return ImmutableSet.<CommunityVar>builder()
        .addAll(
            matchCommunities.getCommunitySetExpr().accept(new CommunitySetExprVarCollector(), arg))
        .addAll(
            matchCommunities
                .getCommunitySetMatchExpr()
                .accept(new CommunitySetMatchExprVarCollector(), arg))
        .build();
  }

}