mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
9 lines
293 B
Java
9 lines
293 B
Java
// "Collapse loop with stream 'sum()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public void testPrimitiveMap(List<String> data) {
|
|
long sum = data.stream().filter(str -> str.startsWith("xyz")).mapToInt(String::length).filter(len -> len > 10).asLongStream().sum();
|
|
}
|
|
} |