@Test
public void testRemoveDuringIteration4() {

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