You win for "rules lawyering."
IOOBE, not a real word, is easier than writing IndexOutOfBoundsException. Though, I could have cited first, then used the "acronym."
I know that an ArrayList is zero-indexed. I did pass the SCJP exam...allow me to bask in my self congratulatory sun...now...
What I was trying to say, though I was unclear, is better demo'd in code...
What I have found is that if the order of the products provided in the original list is not naturally ordered, and arrives at line 16 above, the ArrayList throws an IOOBE on the add method.
What is not clear in the ArrayList documentation is that the first item added to an ArrayList must
be at index 0.
Or is that documented somewhere; everywhere I looked it seemed assumed (and is a safe assumption I suppose), but the developer writing the above code, of which I'm reviewing, seems to insist this is possible. I couldn't refute, so I came here.