@Test
public void testAdditionDuringIteration() {

    SafeIterableMap<Integer, Boolean> map = mapOf(1, 2, 3, 4);
    int[] expected = new int[]{1, 2, 3, 4};
    int index = 0;
    for (Entry<Integer, Boolean> entry : map) {
        assertThat(entry.getKey(), is(expected[index++]));
        if (index == 1) {
            map.putIfAbsent(5, true);
        }
    }
}