@Test public void testVisitTypesFirstAscendingSpaceSeparated() { CommunitySetRendering r = new TypesFirstAscendingSpaceSeparated(IntegerValueRendering.instance()); assertThat( r.accept( CommunitySetToRegexInputString.instance(), CommunitySet.of( LargeCommunity.of(0L, 0L, 1L), ExtendedCommunity.of(0, 0L, 3L), ExtendedCommunity.of(0, 0L, 4L), StandardCommunity.of(5L), LargeCommunity.of(0L, 0L, 2L), StandardCommunity.of(6L))), equalTo("5 6 3 4 1 2")); }
@Override public String visitTypesFirstAscendingSpaceSeparated( TypesFirstAscendingSpaceSeparated typesFirstAscendingSpaceSeparated, CommunitySet arg) { return arg.getCommunities().stream() .sorted(TYPES_FIRST_ASCENDING_COMPARATOR) .map( c -> typesFirstAscendingSpaceSeparated .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), c)) .collect(Collectors.joining(" ")); }
CommunitySetToRegexInputString implements CommunitySetRenderingVisitor<String, CommunitySet> { @Override public String visitTypesFirstAscendingSpaceSeparated( TypesFirstAscendingSpaceSeparated typesFirstAscendingSpaceSeparated, CommunitySet arg) { return arg.getCommunities().stream() .sorted(TYPES_FIRST_ASCENDING_COMPARATOR) .map( c -> typesFirstAscendingSpaceSeparated .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), c)) .collect(Collectors.joining(" ")); } }
CommunitySetToRegexInputString implements CommunitySetRenderingVisitor<String, CommunitySet> { @Override public String visitTypesFirstAscendingSpaceSeparated( TypesFirstAscendingSpaceSeparated typesFirstAscendingSpaceSeparated, CommunitySet arg) { return arg.getCommunities().stream() .sorted(TYPES_FIRST_ASCENDING_COMPARATOR) .map( c -> typesFirstAscendingSpaceSeparated .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), c)) .collect(Collectors.joining(" ")); } private  CommunitySetToRegexInputString(); }
CommunitySetToRegexInputString implements CommunitySetRenderingVisitor<String, CommunitySet> { @Override public String visitTypesFirstAscendingSpaceSeparated( TypesFirstAscendingSpaceSeparated typesFirstAscendingSpaceSeparated, CommunitySet arg) { return arg.getCommunities().stream() .sorted(TYPES_FIRST_ASCENDING_COMPARATOR) .map( c -> typesFirstAscendingSpaceSeparated .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), c)) .collect(Collectors.joining(" ")); } private  CommunitySetToRegexInputString(); static @Nonnull CommunitySetToRegexInputString instance(); @Override String visitTypesFirstAscendingSpaceSeparated(
      TypesFirstAscendingSpaceSeparated typesFirstAscendingSpaceSeparated, CommunitySet arg); }
CommunitySetToRegexInputString implements CommunitySetRenderingVisitor<String, CommunitySet> { @Override public String visitTypesFirstAscendingSpaceSeparated( TypesFirstAscendingSpaceSeparated typesFirstAscendingSpaceSeparated, CommunitySet arg) { return arg.getCommunities().stream() .sorted(TYPES_FIRST_ASCENDING_COMPARATOR) .map( c -> typesFirstAscendingSpaceSeparated .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), c)) .collect(Collectors.joining(" ")); } private  CommunitySetToRegexInputString(); static @Nonnull CommunitySetToRegexInputString instance(); @Override String visitTypesFirstAscendingSpaceSeparated(
      TypesFirstAscendingSpaceSeparated typesFirstAscendingSpaceSeparated, CommunitySet arg);  }