Files
openide/java/java-tests/testData/inspection/streamApiCallChains/beforeCollectorReducing3.java
T

10 lines
316 B
Java

// "Replace 'collect(reducing())' with 'map().reduce()'" "true"
import java.util.List;
import java.util.stream.Collectors;
public class Main {
public int sum(List<String> data) {
return data.stream().filter(x -> x.startsWith("xyz")).colle<caret>ct(Collectors.reducing(0, String::length, Integer::sum));
}
}