@Override
  public E next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }

    E result = (E)current;
    isNextObtained = false;
    return result;
  }
@Override
  public E next()