package Examples; import java.util.Iterator; //originally an inner class of LinkedList, but taken out because pitest //can't deal with inner class public class DescendingIterator implements Iterator { private JavaLinkedList parentList ; private final ListItr itr ; public DescendingIterator(JavaLinkedList parentList) { this.parentList = parentList ; itr = new ListItr(parentList,parentList.size()); } public boolean hasNext() { return itr.hasPrevious(); } public E next() { return itr.previous(); } public void remove() { itr.remove(); } }