On Oct 30, 2013, at 5:54 PM, Henry Jen <henry....@oracle.com> wrote:
> Looks good to me. > > In the test, > >> Integer one = Stream.iterate(1, i -> i + >> 1).unordered().parallel().distinct().findAny().get(); >> assertEquals(one.intValue(), 1); > > The implementation is probably make sure this will return 1, but is that what > we spec to do? I sort of think it can have various values depends on how many > working threads and their scheduling. > Doh! you are correct, sorry, i made a silly mistake and had this in my head "Stream.iterate(1, i -> i + 1).parallel().distinct().findFirst().get()" when i responded. This test is failing in some cases exactly for the reasons you give. Paul.