void () { for (int size : new int[]{0, 1, 2, 3, 4, 10, 11, 12}) { UnmodifiableHashMap<Integer, String> map = create(size); Set<Integer> keys = new java.util.HashSet<>(); Set<String> values = new java.util.HashSet<>(); map.forEach((k, v) -> { keys.add(k); values.add(v); }); assertEquals(IntStreamEx.range(size).boxed().toSet(), keys); assertEquals(IntStreamEx.range(size).mapToObj(String::valueOf).toSet(), values); } }