Hacker News new | ask | show | jobs
by incepted 3859 days ago
How about this then?

    IntStream.range(0, 100).filter(::even);
1 comments

Not quite what was asked. The intended outcome is a sequence of length 1000 where the elements are 1 * true, 2 * false, 3 * true, 4 * false and so on.

To compare it with what your code produces.

[true false false true true true false false false false ...]

[true false true false true false true false true false ...]