@Test public void testMatchCommunities() { Set<Community> matchingCommunitySetCandidate1 = ImmutableSet.of(StandardCommunity.of(1L), StandardCommunity.of(2L)); Set<Community> matchingCommunitySetCandidate2 = ImmutableSet.of(StandardCommunity.of(1L)); Set<Community> nonMatchingCommunitySetCandidate = ImmutableSet.of(StandardCommunity.of(2L)); NamedCommunitySet expr = new NamedCommunitySet(COMMUNITY_LIST_NAME); assertThat(expr, matchCommunities(_env, matchingCommunitySetCandidate1)); assertThat(expr, matchCommunities(_env, matchingCommunitySetCandidate2)); assertThat(expr, not(matchCommunities(_env, nonMatchingCommunitySetCandidate))); }
@Override public boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate) { return resolve(environment).matchCommunities(environment, communitySetCandidate); }
NamedCommunitySet extends CommunitySetExpr { @Override public boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate) { return resolve(environment).matchCommunities(environment, communitySetCandidate); } }
NamedCommunitySet extends CommunitySetExpr { @Override public boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate) { return resolve(environment).matchCommunities(environment, communitySetCandidate); } NamedCommunitySet(@Nonnull String name); }
NamedCommunitySet extends CommunitySetExpr { @Override public boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate) { return resolve(environment).matchCommunities(environment, communitySetCandidate); } NamedCommunitySet(@Nonnull String name); @Override T accept(CommunitySetExprVisitor<T> visitor); @Override void accept(VoidCommunitySetExprVisitor visitor); @Nonnull @Override Set<Community> asLiteralCommunities(@Nonnull Environment environment); @Override final boolean dynamicMatchCommunity(); @Override boolean equals(Object obj); @JsonProperty(PROP_NAME) String getName(); @Override int hashCode(); @Override boolean matchAnyCommunity(Environment environment, Set<Community> communityCandidates); @Override boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate); @Override boolean matchCommunity(Environment environment, Community community); @Override Set<Community> matchedCommunities(
      Environment environment, Set<Community> communityCandidates); @Override boolean reducible(); }
NamedCommunitySet extends CommunitySetExpr { @Override public boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate) { return resolve(environment).matchCommunities(environment, communitySetCandidate); } NamedCommunitySet(@Nonnull String name); @Override T accept(CommunitySetExprVisitor<T> visitor); @Override void accept(VoidCommunitySetExprVisitor visitor); @Nonnull @Override Set<Community> asLiteralCommunities(@Nonnull Environment environment); @Override final boolean dynamicMatchCommunity(); @Override boolean equals(Object obj); @JsonProperty(PROP_NAME) String getName(); @Override int hashCode(); @Override boolean matchAnyCommunity(Environment environment, Set<Community> communityCandidates); @Override boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate); @Override boolean matchCommunity(Environment environment, Community community); @Override Set<Community> matchedCommunities(
      Environment environment, Set<Community> communityCandidates); @Override boolean reducible();  }