code: public boolean hasNext() {
          if (currentIndex == endIndex) {
              return false;
          }
                
          // Otherwise, see if nextElement is null. If so, try to load the next
          // element to make sure it exists.
          if (nextElement == null) {
              nextElement = getNextElement();
              if (nextElement == null) {
                  return false;
              }
          }
          return true;
      }
docs: Returns true if there are more elements in the iteration.
  
  @return true if the iterator has more elements.