mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-25 10:51:06 +07:00
10 lines
294 B
Java
10 lines
294 B
Java
// "Collapse loop with stream 'count()'" "true-preview"
|
|
|
|
import java.util.Arrays;
|
|
|
|
public class Main {
|
|
public long test(String[] array) {
|
|
long longStrings = Arrays.stream(array).map(String::trim).filter(trimmed -> trimmed.length() > 10).limit(100).count();
|
|
return longStrings;
|
|
}
|
|
} |