mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-27 05:20:54 +07:00
10 lines
284 B
Java
10 lines
284 B
Java
// "Collapse loop with stream 'count()'" "true-preview"
|
|
|
|
import java.util.Arrays;
|
|
|
|
public class Main {
|
|
public int testPrimitiveArray(int[] data) {
|
|
int count = (int) Arrays.stream(data).mapToLong(val -> val * val).filter(square -> square > 100).count();
|
|
return count;
|
|
}
|
|
} |