I've tested your proposed fix and it works (no real surprise there).
I'll see if I can find time to create a test case but I'd argue that given it is obvious that the current code is wrong (as per the Iterator.remove() javadoc: "...The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.") and the fix is trivial, shouldn't the code just be fixed.
Looks like I'll have to create my own fork in the meantime.
I've tested your proposed fix and it works (no real surprise there).
I'll see if I can find time to create a test case but I'd argue that given it is obvious that the current code is wrong (as per the Iterator.remove() javadoc: "...The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.") and the fix is trivial, shouldn't the code just be fixed.
Looks like I'll have to create my own fork in the meantime.