In this task, you must write an iterator for a custom data structure representing an array of variable length (a so-called dynamic array). The iterator you will write must implement the provided ArrayIterator<T> interface. Also, don't forget to add and complete the public ArrayIterator<T> iterator() method.
The DynamicArray<T> has a bunch of methods and may be created with an arbitrary initial capacity. It will initially hold the specified number of null elements. Note that the size of DinamicArray changes if an element is appended to or removed from it.