@Test public void testSummarizeEmpty() { assertThat(new PrefixTracer().summarize(), anEmptyMap()); }
public Map<Prefix, Map<String, Set<String>>> summarize() { Map<Prefix, Map<String, Set<String>>> result = new HashMap<>(); _sent.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(SENT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnExport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_OUT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnImport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_IN, a -> new HashSet<>()) .add(neighbor.getHostname()))); _installed.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(RECEIVED, a -> new HashSet<>()) .add(neighbor.getHostname()))); return result; }
PrefixTracer implements Serializable { public Map<Prefix, Map<String, Set<String>>> summarize() { Map<Prefix, Map<String, Set<String>>> result = new HashMap<>(); _sent.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(SENT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnExport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_OUT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnImport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_IN, a -> new HashSet<>()) .add(neighbor.getHostname()))); _installed.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(RECEIVED, a -> new HashSet<>()) .add(neighbor.getHostname()))); return result; } }
PrefixTracer implements Serializable { public Map<Prefix, Map<String, Set<String>>> summarize() { Map<Prefix, Map<String, Set<String>>> result = new HashMap<>(); _sent.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(SENT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnExport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_OUT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnImport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_IN, a -> new HashSet<>()) .add(neighbor.getHostname()))); _installed.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(RECEIVED, a -> new HashSet<>()) .add(neighbor.getHostname()))); return result; } PrefixTracer();   PrefixTracer(@Nonnull PrefixSpace prefixesToTrace); }
PrefixTracer implements Serializable { public Map<Prefix, Map<String, Set<String>>> summarize() { Map<Prefix, Map<String, Set<String>>> result = new HashMap<>(); _sent.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(SENT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnExport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_OUT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnImport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_IN, a -> new HashSet<>()) .add(neighbor.getHostname()))); _installed.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(RECEIVED, a -> new HashSet<>()) .add(neighbor.getHostname()))); return result; } PrefixTracer();   PrefixTracer(@Nonnull PrefixSpace prefixesToTrace); SortedSet<Prefix> getOriginated(); Map<Prefix, Set<Neighbor>> getSent(); Map<Prefix, Set<Neighbor>> getInstalled(); Map<Prefix, Set<Neighbor>> getFiltered(Direction direction); Map<Prefix, Map<String, Set<String>>> summarize(); }
PrefixTracer implements Serializable { public Map<Prefix, Map<String, Set<String>>> summarize() { Map<Prefix, Map<String, Set<String>>> result = new HashMap<>(); _sent.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(SENT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnExport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_OUT, a -> new HashSet<>()) .add(neighbor.getHostname()))); _filteredOnImport.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(FILTERED_IN, a -> new HashSet<>()) .add(neighbor.getHostname()))); _installed.forEach( (prefix, neighbors) -> neighbors.forEach( neighbor -> result .computeIfAbsent(prefix, p -> new HashMap<>()) .computeIfAbsent(RECEIVED, a -> new HashSet<>()) .add(neighbor.getHostname()))); return result; } PrefixTracer();   PrefixTracer(@Nonnull PrefixSpace prefixesToTrace); SortedSet<Prefix> getOriginated(); Map<Prefix, Set<Neighbor>> getSent(); Map<Prefix, Set<Neighbor>> getInstalled(); Map<Prefix, Set<Neighbor>> getFiltered(Direction direction); Map<Prefix, Map<String, Set<String>>> summarize();  }