Stream of boolean values, is any true?

Streams API actually has first-class support for your requirement:

setOfE.parallelStream().anyMatch(e -> eval(e));

As opposed to your approach with reduce, this is guaranteed to have short-circuit evaluation and optimally leverage parallelism.

Leave a Comment

error code: 521