/** * Returns the next element in this iteration. * * @return the next element. */ @Override public E next() { E value = next; if (value == null) { if (!hasNext()) { throw new NoSuchElementException(); } value = next; } next = null; return value; }
/** * Returns the next element in this iteration. * * @return the next element. */ @Override public E next() { E value = next; if (value == null) { if (!hasNext()) { throw new NoSuchElementException(); } value = next; } next = null; return value; } }