@Test
public void testListIterator() {

    IntegerUnion iu = new IntegerUnion(Arrays.asList(5, 10, 11, 12, 13, 45, 46));
    List<Integer> model = new ArrayList<>(Arrays.asList(5, 10, 11, 12, 13, 45, 46));
    ListIterator<Integer> it = iu.listIterator();
    ListIterator<Integer> modelIt = model.listIterator();
    assertFalse(it.hasPrevious());
    assertTrue(it.hasNext());
    assertEquals(modelIt.next(), it.next()); // 5
    assertTrue(it.hasNext());
    assertEquals(modelIt.next(), it.next()); // 10
    assertTrue(it.hasPrevious());
    assertEquals(modelIt.previous(), it.previous()); // 10
    assertTrue(it.hasPrevious());
    assertEquals(modelIt.previous(), it.previous()); // 5
    assertTrue(it.hasNext());
    assertEquals(modelIt.next(), it.next()); // 5
    assertTrue(it.hasNext());
    assertEquals(modelIt.next(), it.next()); // 10
    assertTrue(it.hasNext());
    assertEquals(modelIt.next(), it.next()); // 11
    assertTrue(it.hasNext());
    assertEquals(modelIt.next(), it.next()); // 12
    assertTrue(it.hasNext());
    assertEquals(modelIt.next(), it.next()); // 13
    assertTrue(it.hasPrevious());
    assertEquals(modelIt.previous(), it.previous()); // 13
    assertTrue(it.hasPrevious());
    assertEquals(modelIt.previous(), it.previous()); // 12
    assertTrue(it.hasPrevious());
    assertEquals(modelIt.previous(), it.previous()); // 11
    assertTrue(it.hasPrevious());
    assertEquals(modelIt.previous(), it.previous()); // 10
    assertTrue(it.hasPrevious());
    assertEquals(modelIt.previous(), it.previous()); // 5
    assertFalse(it.hasPrevious());
}