@Test public void testGetVrfs() { String int1 = "int1"; String int2 = "int2"; String int3 = "int3"; String vrf1 = "vrf1"; String vrf2 = "vrf2"; Map<String, Configuration> configs = new HashMap<>(); Configuration config = createTestConfiguration("config1", ConfigurationFormat.HOST, int1, int2, int3); config.getAllInterfaces().get(int1).setVrfName(vrf1); config.getAllInterfaces().get(int2).setVrfName(vrf2); config.getAllInterfaces().get(int3).setVrfName(vrf1); configs.put("config1", config); assertThat(getVrfs(configs), equalTo(ImmutableSet.of(vrf1, vrf2))); }
public static Set<String> getVrfs(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> vrfs = ImmutableSet.builder(); configurations .values() .forEach( configuration -> configuration.getAllInterfaces().values().stream() .map(Interface::getVrfName) .forEach(vrfs::add)); return vrfs.build(); }
CompletionMetadataUtils { public static Set<String> getVrfs(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> vrfs = ImmutableSet.builder(); configurations .values() .forEach( configuration -> configuration.getAllInterfaces().values().stream() .map(Interface::getVrfName) .forEach(vrfs::add)); return vrfs.build(); } }
CompletionMetadataUtils { public static Set<String> getVrfs(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> vrfs = ImmutableSet.builder(); configurations .values() .forEach( configuration -> configuration.getAllInterfaces().values().stream() .map(Interface::getVrfName) .forEach(vrfs::add)); return vrfs.build(); } private  CompletionMetadataUtils(); }
CompletionMetadataUtils { public static Set<String> getVrfs(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> vrfs = ImmutableSet.builder(); configurations .values() .forEach( configuration -> configuration.getAllInterfaces().values().stream() .map(Interface::getVrfName) .forEach(vrfs::add)); return vrfs.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> getVrfs(Map<String, Configuration> configurations) { ImmutableSet.Builder<String> vrfs = ImmutableSet.builder(); configurations .values() .forEach( configuration -> configuration.getAllInterfaces().values().stream() .map(Interface::getVrfName) .forEach(vrfs::add)); return vrfs.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; }