public static long count(int[] arr, int a) { return IntStream.of(arr) .filter(n -> n > 0) .filter(n -> n <= a) .count(); }