@Test
public void listIterator() throws Exception {

    ReItrLinkedList<String> l = new ReItrLinkedList<>();
    String[] strs = {"abc", "123", "hehe"};
    Collections.addAll(l, strs);
    ReusableListIterator<String> itr = l.listIterator();
    assertEquals(strs[0], itr.next());
    assertEquals(strs[1], itr.next());
    assertEquals(strs[1], itr.previous());
    ReusableIterator<String> retItr = itr.rewind();
    assertTrue(retItr == itr);
    assertFalse(itr.hasPrevious());
    assertEquals(strs[0], itr.next());
    // rewind with index
    retItr = itr.rewind(1);
    assertTrue(retItr == itr);
    assertTrue(itr.hasPrevious());
    assertEquals(0, itr.previousIndex());
    assertEquals(1, itr.nextIndex());
    assertEquals(strs[1], itr.next());
}