class ArrayIterator implements Iterator<T> {

    private int nextIndex;

    ArrayIterator() {
      nextIndex = 0;
    }

    @Override
    public boolean hasNext() {
      return nextIndex < numElements;
    }

    @Override
    public T next() throws NoSuchElementException {
      if (!(nextIndex < numElements)) {
        throw new NoSuchElementException();
      }

      return elements[nextIndex++];
    }

    @Override
    public void remove() throws NoSuchElementException {
      if (nextIndex == 0) {
        throw new NoSuchElementException();
      } else {
        removeElementAt(nextIndex - 1);
        nextIndex = nextIndex - 1;
      }
    }
  }

  private void removeElementAt(int index) {<FILL_FUNCTION_BODY>

    throw new UnsupportedOperationException();
    /*
     * // Handle simple case if(index == numElements - 1) { numElements--; return; }
     *
     * // Else, shift over elements System.arraycopy(elements, index + 1, elements, index, numElements - (index + 1));
     * numElements--;
     */
  
<methods>public void <init>() ,public void <init>(int) ,public void <init>(Map<? extends K,? extends V>) ,public void <init>(int, float) ,public void clear() ,public java.lang.Object clone() ,public V compute(K, BiFunction<? super K,? super V,? extends V>) ,public V computeIfAbsent(K, Function<? super K,? extends V>) ,public V computeIfPresent(K, BiFunction<? super K,? super V,? extends V>) ,public boolean containsKey(java.lang.Object) ,public boolean containsValue(java.lang.Object) ,public Set<Entry<K,V>> entrySet() ,public void forEach(BiConsumer<? super K,? super V>) ,public V get(java.lang.Object) ,public V getOrDefault(java.lang.Object, V) ,public boolean isEmpty() ,public Set<K> keySet() ,public V merge(K, V, BiFunction<? super V,? super V,? extends V>) ,public V put(K, V) ,public void putAll(Map<? extends K,? extends V>) ,public V putIfAbsent(K, V) ,public V remove(java.lang.Object) ,public boolean remove(java.lang.Object, java.lang.Object) ,public V replace(K, V) ,public boolean replace(K, V, V) ,public void replaceAll(BiFunction<? super K,? super V,? extends V>) ,public int size() ,public Collection<V> values() <variables>static final int DEFAULT_INITIAL_CAPACITY,static final float DEFAULT_LOAD_FACTOR,static final int MAXIMUM_CAPACITY,static final int MIN_TREEIFY_CAPACITY,static final int TREEIFY_THRESHOLD,static final int UNTREEIFY_THRESHOLD,transient Set<Entry<K,V>> entrySet,final float loadFactor,transient int modCount,private static final long serialVersionUID,transient int size,transient Node<K,V>[] table,int threshold