@Override
    public E next() {
      if (!hasNext()) {
        throw new NoSuchElementException();
      }
      lastRet = cursor;
      //noinspection unchecked
      return (E)snapshot[cursor++];
    }
@Override
    public E next()