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.
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.