@Test
public void testForEach() {

    IntList list = new IntList();
    IntList other = new IntList();
    list.forEach(other::add);
    assertThat(other.toArray()).isEmpty();
    list.add(10);
    list.add(5);
    list.forEach(other::add);
    assertThat(list.toArray()).containsExactly(10, 5);
}