forEach() の呼び出しを報告します。
例:
List<String> findNStrings(List<String> list, int n) {
List<String> other = new ArrayList<>();
list.forEach(s -> {
if(s.length() > n) other.add(s);
});
return other;
}
クイックフィックス適用後:
List<String> findNStrings(List<String> list, int n) {
List<String> other = list.stream()
.filter(s -> s.length() > n)
.collect(Collectors.toList());
return other;
}
2017.3 の新機能です