(String[] args)
| 52 | .toCollection(LinkedHashSet::new)); |
| 53 | } |
| 54 | public static void main(String[] args) { |
| 55 | final int size = 6; |
| 56 | CountMap cm = new CountMap(60); |
| 57 | System.out.println(cm); |
| 58 | System.out.println(cm.get(500)); |
| 59 | cm.values().stream() |
| 60 | .limit(size) |
| 61 | .forEach(System.out::println); |
| 62 | System.out.println(); |
| 63 | new Random(47).ints(size, 0, 1000) |
| 64 | .mapToObj(cm::get) |
| 65 | .forEach(System.out::println); |
| 66 | } |
| 67 | } |
| 68 | /* Output: |
| 69 | {0=A0, 1=B0, 2=C0, 3=D0, 4=E0, 5=F0, 6=G0, 7=H0, 8=I0, |