Why don't you have access to collections? Is it a
test?
If so, you can consider making your own primitive list implementation. Just start with an array of arbitrary size, and a counter. For each element you retrieve from the iterator, add it to the array and increment the counter. When the counter reaches the size of the array, you copy all the elements of the array to a new array that's twice the size of the old array.
Finally, you could optionally trim the size of the array down when you get the last element.