@Test
public void iterator() throws Exception {

    ReItrLinkedList<String> l = new ReItrLinkedList<>();
    String[] strs = {"abc", "123", "hehe"};
    Collections.addAll(l, strs);
    ReusableIterator<String> itr = l.iterator();
    assertEquals(strs[0], itr.next());
    assertEquals(strs[1], itr.next());
    ReusableIterator<String> retItr = itr.rewind();
    assertTrue(retItr == itr);
    assertEquals(strs[0], itr.next());
    assertEquals(strs[1], itr.next());
    assertEquals(strs[2], itr.next());
    // exception
    try {
        itr.next();
        fail("should throw exception");
    } catch (NoSuchElementException ignored) {
    }
}