posted 18 years ago
Yes it is possible.
Specifically, the call to List.iterator() is non-monadic - it returns two different "values" (for some definition of "value" - not to be confused with "instance identity"). Unfortunately, the iterator also exposes an operation called "remove" - do not call invoke this operation while you have more than one iterator over your list, since it results in runtime failure.
Tony Morris
Java Q&A (FAQ, Trivia)