/** * Gets the next element from the array. * * @return the next element * @throws NoSuchElementException if there is no next element */ @Override public E next() { if (hasNext() == false) { throw new NoSuchElementException(); } this.lastItemIndex = this.index; return this.array[this.index++]; }