Open
Description
The corrupted code:
@Override
public boolean contains(T element) {
requireNonNull(element);
Node<T> current = head;
if(!isEmpty()){
while (current.next != null){
if (current.element.equals(element)){
return true;
}
current = current.next;
}
}
return false;
}
It would be great to check in tests for the presence of the last element in the list.
Metadata
Metadata
Assignees
Labels
No labels