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