In the web I found only one way to stop the iterate method. By using the limit() function. But that iterates a concreate ammount of loops. I want use for the halt a predicate.
...
Stream.iterate(0, i -> i*2).while(i -> i < MAX)
...
Is there a way to do it with Streams?
Update 1 : Java 8 is used