takeWhile() working differently with flatmap
This is a bug in JDK 9 – from issue #8193856: takeWhile is incorrectly assuming that an upstream operation supports and honors cancellation, which unfortunately is not the case for flatMap. Explanation If the stream is ordered, takeWhile should show the expected behavior. This is not entirely the case in your code because you use … Read more