This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
An empty list can be found between any two elements of a list, as well as before the first and after the last. This is similar to how there's an empty String between any two characters of any String, as well as before the first and after the last.
Following the above logic, indexOfSubList should return 0 (before the first element) when looking for an empty list. -1 means the empty list cannot be found, and that's certainly not the case.
The empty list is a sublist of every list, the empty set is a subset of every set, and the empty String is a substring of every String. If there are positions, those sub-things can be found at any positions.
Something we forget so often, and get confused about.