@@ -952,14 +952,14 @@ public void forEachRemaining(Consumer<? super E> action) { Objects.requireNonNull(action); while (modCount == expectedModCount && nextIndex < size) { action.accept(next.item); + lastReturned = next; next = next.next; nextIndex++; } - lastReturned = next; checkForComodification(); } final void checkForComodification() { if (modCount != expectedModCount)