Reports loops which can be collapsed into a single 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));