Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6r9iSyHu5qSJMzH2n
9 lines
519 B
Plaintext
9 lines
519 B
Plaintext
removeFirst() on an empty list, 2015 version and this module
|
|
============================================================
|
|
|
|
2015 list holding the value 0: removeFirst() returned 0
|
|
2015 list that is empty: removeFirst() returned 0 (and printed: List is empty - nothing to remove)
|
|
A caller that only looks at the return value cannot tell these two cases apart.
|
|
this module, list holding 0: removeFirst() returned 0
|
|
this module, now empty: removeFirst() throws NoSuchElementException: list is empty
|