@Test public void testGetRoutingPolicyNames() { String policy1 = "policy1"; String policy2 = "policy2"; RoutingPolicy routingPolicy1 = RoutingPolicy.builder().setName(policy1).build(); RoutingPolicy routingPolicy2 = RoutingPolicy.builder().setName(policy2).build(); Map<String, Configuration> configs = new HashMap<>(); Configuration config = createTestConfiguration("config1", ConfigurationFormat.HOST); config.setRoutingPolicies( ImmutableSortedMap.of(policy1, routingPolicy1, policy2, routingPolicy2)); configs.put("config1", config); assertThat(getRoutingPolicyNames(configs), equalTo(ImmutableSet.of(policy1, policy2))); }
public static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> routingPolicyNames = ImmutableSet.builder(); configurations .values() .forEach( configuration -> routingPolicyNames.addAll(configuration.getRoutingPolicies().keySet())); return routingPolicyNames.build(); }
CompletionMetadataUtils { public static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> routingPolicyNames = ImmutableSet.builder(); configurations .values() .forEach( configuration -> routingPolicyNames.addAll(configuration.getRoutingPolicies().keySet())); return routingPolicyNames.build(); } }
CompletionMetadataUtils { public static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> routingPolicyNames = ImmutableSet.builder(); configurations .values() .forEach( configuration -> routingPolicyNames.addAll(configuration.getRoutingPolicies().keySet())); return routingPolicyNames.build(); } private  CompletionMetadataUtils(); }
CompletionMetadataUtils { public static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> routingPolicyNames = ImmutableSet.builder(); configurations .values() .forEach( configuration -> routingPolicyNames.addAll(configuration.getRoutingPolicies().keySet())); return routingPolicyNames.build(); } private  CompletionMetadataUtils(); static Set<String> getFilterNames(Map<String, Configuration> configurations); static Set<NodeInterfacePair> getInterfaces(Map<String, Configuration> configurations); static Map<Ip, IpCompletionMetadata> getIps(Map<String, Configuration> configurations); static Set<String> getMlagIds(Map<String, Configuration> configurations); static Map<String, NodeCompletionMetadata> getNodes(
      Map<String, Configuration> configurations); static Set<String> getPrefixes(Map<String, Configuration> configurations); static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations); static Set<Location> getSourceLocationsWithSrcIps(
      Map<Location, LocationInfo> locationInfo); static Set<String> getStructureNames(Map<String, Configuration> configurations); static Set<String> getVrfs(Map<String, Configuration> configurations); static Set<String> getZones(Map<String, Configuration> configurations); }
CompletionMetadataUtils { public static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> routingPolicyNames = ImmutableSet.builder(); configurations .values() .forEach( configuration -> routingPolicyNames.addAll(configuration.getRoutingPolicies().keySet())); return routingPolicyNames.build(); } private  CompletionMetadataUtils(); static Set<String> getFilterNames(Map<String, Configuration> configurations); static Set<NodeInterfacePair> getInterfaces(Map<String, Configuration> configurations); static Map<Ip, IpCompletionMetadata> getIps(Map<String, Configuration> configurations); static Set<String> getMlagIds(Map<String, Configuration> configurations); static Map<String, NodeCompletionMetadata> getNodes(
      Map<String, Configuration> configurations); static Set<String> getPrefixes(Map<String, Configuration> configurations); static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations); static Set<Location> getSourceLocationsWithSrcIps(
      Map<Location, LocationInfo> locationInfo); static Set<String> getStructureNames(Map<String, Configuration> configurations); static Set<String> getVrfs(Map<String, Configuration> configurations); static Set<String> getZones(Map<String, Configuration> configurations); static Map<Ip, String> WELL_KNOWN_IPS; }