単一の Collection.removeIf() の呼び出しに縮小できるループを報告します。

例:


  for (Iterator<String> it = collection.iterator(); it.hasNext(); ) {
    String aValue = it.next();
    if(shouldBeRemoved(aValue)) {
      it.remove();
    }
  }

クイックフィックス適用後:


  collection.removeIf(aValue -> shouldBeRemoved(aValue));