Solution (source code)

= Solution

The two abstract methods are
``
def hasNext: Boolean
def next(): T
``
The first reports availability; the second returns and consumes the next entry, or throws a `NoSuchElementException` if none exists. Other standard <iterator> operations are supplied in terms of this interface. Repeated availability checks must not lose entries, although they may perform preparatory internal work.<Scala 2.13 iterator API documentation>[Iterator, abstract members hasNext and next; class-level mutation and reuse contract]{ref}