private class LinkedListIterator implements ListIterator { . . . public void set(Object obj) { if (position == null) throw new NoSuchElementException(); position.data = obj; } . . . }