Inspectopedia
 
2024.3

Loop can be replaced with 'Collection.removeIf()'

Warning
New
Last modified: 03 December 2024

Reports loops which can be collapsed into a single Collection.removeIf() call.

Example:

After the quick-fix is applied:

This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.