mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 20:07:01 +07:00
10 lines
259 B
Java
10 lines
259 B
Java
// "Collapse loop with stream 'sum()'" "true-preview"
|
|
|
|
import java.util.Arrays;
|
|
|
|
public class Main {
|
|
public long test(String[] array) {
|
|
long i = Arrays.stream(array).filter(a -> a.startsWith("xyz")).mapToLong(String::length).sum();
|
|
return i;
|
|
}
|
|
} |