I am playing around with lazy functional operations in Java SE 8, and I want to map
an index i
to a pair / tuple (i, value[i])
, then <
Since you only care about the indexes, you don't need to map to tuples at all. Why not just write a filter that uses the looks up elements in your array?
int[] value = ...
IntStream.range(0, value.length)
.filter(i -> value[i] > 30) //or whatever filter you want
.forEach(i -> System.out.println(i));