Collection.removeIf
call.
For example:
for (Iterator<String> it = collection.iterator(); it.hasNext(); ) { String aValue = it.next(); if(shouldBeRemoved(aValue)) { it.remove(); } }
This inspection only reports if the language level of the project or module is 8 or higher
New in 2016.3