WorldMap { public List<Entry> getEntries() { return geoCodeCounts.entrySet().stream() .filter(entry -> entry.getValue() != 0) .map(e -> new Entry(e.getKey(), e.getValue())) .collect(Collectors.toList()); } WorldMap(PlayersMutator mutator);   WorldMap(Map<String, Integer> geolocationCounts); List<Entry> getEntries();  }
@Test void toGeolocationCountsCausesNoException() { Map<String, Integer> geolocations = new HashMap<>(); geolocations.put("Finland", 1); geolocations.put("Sweden", 1); geolocations.put("Not Known", 1); geolocations.put("Local Machine", 1); geolocations.put("Denmark", 2); List<WorldMap.Entry> expected = Arrays.asList( new WorldMap.Entry("SWE", 1), new WorldMap.Entry("DNK", 2), new WorldMap.Entry("FIN", 1) ); List<WorldMap.Entry> result = new WorldMap(geolocations).getEntries(); assertEquals(expected, result); }