public boolean hasNext() {
        return (progressToken.hasPending() || bucketSource.hasNext()) && !bucketSource.shouldYield();
    }
<p>Check whether or not it is valid to call {@link #getNext()} with the current
iterator state.</p>

<p>There exists a case wherein <code>hasNext</code> may return false before {@link #update} is
called, but true afterwards. This happens when the set of pending buckets is
empty, the bucket source is empty <em>but</em> the set of active buckets is
not. A future progress update on any of the buckets in the active set may
or may not make that bucket available to the pending set again.
This must be handled explicitly by the caller by checking {@link #isDone()}
and ensuring that {@link #update} is called before retrying <code>hasNext</code>.</p>

<p>This method will also return false if the number of distribution bits have
changed and there are active buckets needing to be flushed before the
iterator will allow new buckets to be handed out.</p>

@return Whether or not it is valid to call {@link #getNext()} with the current
iterator state.
documentapi/src/main/java/com/yahoo/documentapi/VisitorIterator.java