This code will throw a ConcurrentModificationException in case there actually are elements to remove. See here for a similar SO issue. Generally, you cannot modify a Collection in Java while iterating through it without explicitly using the Iterator (which is not possibly while streaming).
This came to light while writing this unit test, i.e. this issue should be resolved by fixing this test. This will be done in a separate branch though.
as the branch has been superseded by rebasing branch draeger-lab/ModelPolisher/#121-polishing-unit-tests on top of it and the issue has been resolved via 7c28e5e, I am closing this
This code will throw a
ConcurrentModificationException
in case there actually are elements to remove. See here for a similar SO issue. Generally, you cannot modify aCollection
in Java while iterating through it without explicitly using the Iterator (which is not possibly while streaming).This came to light while writing this unit test, i.e. this issue should be resolved by fixing this test. This will be done in a separate branch though.