current = head;
//stop if we reach the end or find it
while (current != null
&& !cureent.data.euals(it)) {
current = current.next;
counter++; //we just passed a node
}
//if the list is empty,
//or we went to the end
if (current == null)
return -1;
return counter;
}
```
---
template: find-final
.left-column2[
.red[
- __What happens when `it == null`?__
- __What happens if we allow elements stored in the nodes to be `null`?__
]
]