mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-24 04:07:09 +07:00
10 lines
291 B
Java
10 lines
291 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")).map(String::length).reduce(0, Integer::sum);
|
|
}
|
|
} |