Implemented Collection::stopWhen()

This is useful when using collections for processing large files or infinite iterators/generators.

For example, a collection could be used to process values from a `yield` generator with no bound condition to it (like a stream of data). This allows the iterator to stop yielding results until certain condition is met.
I'm going to close this pr, I implementing a similar micro optimisation in the other PR