iteratorhasNext
Iterator hasNext is a method commonly found in iterator interfaces that reports whether more elements remain to be traversed. It is a predicate and generally does not advance the iteration; it answers the question of whether a next element exists.
In Java, the typical example is the java.util.Iterator interface, which defines hasNext() and next(). The common
Semantics and guarantees vary by language and implementation. If hasNext() returns true, a call to next() should
Other languages use different names or constructs for a similar concept. For example, Python iterations rely