()
| 44 | } |
| 45 | } |
| 46 | @Override |
| 47 | public Set<Map.Entry<Integer,String>> entrySet() { |
| 48 | // LinkedHashSet retains initialization order: |
| 49 | return IntStream.range(0, size) |
| 50 | .mapToObj(Entry::new) |
| 51 | .collect(Collectors |
| 52 | .toCollection(LinkedHashSet::new)); |
| 53 | } |
| 54 | public static void main(String[] args) { |
| 55 | final int size = 6; |
| 56 | CountMap cm = new CountMap(60); |