Files
openide/java/java-tests/testData/inspection/inefficientStreamCount/afterFlatMapMethodReference.java
T
Tagir Valeev bef996aa8b IDEA-160802 Add inspection to optimize ...flatMap(Collection::stream).count() to ...mapToLong(Collection::size).sum();
New inspection along with Collection.stream().count() -> Collection.size() moved to separate file ReplaceInefficientStreamCountInspection
2016-09-07 15:20:43 +07:00

12 lines
276 B
Java

// "Replace Stream.flatMap().count() with Stream.mapToLong().sum()" "true"
import java.util.Collection;
import java.util.List;
public class Main {
private String s;
public Main(List<List<String>> s) {
long count = s.stream().mapToLong(Collection::size).sum();
}
}