diff --git a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java index 5349c87fc..31b665a34 100644 --- a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java @@ -535,9 +535,7 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se * @param node the node that was added */ protected void nodeInserted(final Node node) { - if (node.previous == current) { - next = node; - } else if (next.previous == node) { + if ((node.previous == current) || (next.previous == node)) { next = node; } else { nextIndexValid = false;