mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 07:20:55 +07:00
10 lines
312 B
Java
10 lines
312 B
Java
// "Collapse loop with stream 'count()'" "true-preview"
|
|
|
|
import java.util.Arrays;
|
|
|
|
public class Main {
|
|
public long test(String[] array, long limit) {
|
|
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(limit + 1).count();
|
|
return longStrings;
|
|
}
|
|
} |