Deprecated Iterators

Using iterators other than for iteration has been proven to be error-prone. It is a mutable object, and if you try to use it like a lazy collection it will inevitably break things if you are not really careful. That's why we dropped extension functions on iterators and introduced Stream<T> type for lazy and functional sequence processing. Basically, operations on Iterable<T> are eager and return snapshots, and operations on Stream<T> are lazy and return streams composed out of original stream and transformations.

Can you elaborate more on how you are using iterators and share some examples of your code? Is it performance-critical code? Are you bound by an external interface you need to comply with?