public Iterator<T> iterator() {
		
		return new Iterator<T>() {
			int ix = -1;
			final long gen = generation;
			public boolean hasNext() {
				check();
				return ix < n - 1;
			}

			public T next() {
				check();
				if (!hasNext()) {
					throw new IllegalStateException("Called next when hasNext is false");
				}
				return (T)data[++ix];
			}

			public void remove() {
				check();
				if (ix == -1) {
					throw new IllegalStateException("You called remove before next");
				}
				throw new UnsupportedOperationException("iterator.remove");
			}
			
			private void check() {
				if (gen != generation) {
					throw new ConcurrentModificationException();
				}
			}
		};
	}