Edit do-while cycle to the work with iterator
Implemented the infinitive loop with class which implements Iterable<T>
Revert "Implemented the infinitive loop with class which implements Iterable<T>"

This reverts commit 84869a80cec72344b59313ba6f2b83d5ecf2abf7.