class IteratorItemReader<T> implements ItemReader<T> {

	/**
	 * Internal iterator
	 */
	private final Iterator<T> iterator;

	/**
	 * Construct a new reader from this iterable (could be a collection), by extracting an
	 * instance of {@link Iterator} from it.
	 * @param iterable in instance of {@link Iterable}
	 *
	 * @see Iterable#iterator()
	 */
	public IteratorItemReader(Iterable<T> iterable) {
		Assert.notNull(iterable, "Iterable argument cannot be null!");
		this.iterator = iterable.iterator();
	}

	/**
	 * Construct a new reader from this iterator directly.
	 * @param iterator an instance of {@link Iterator}
	 */
	public IteratorItemReader(Iterator<T> iterator) {
		Assert.notNull(iterator, "Iterator argument cannot be null!");
		this.iterator = iterator;
	}

	/**
	 * Implementation of {@link ItemReader#read()} that just iterates over the iterator
	 * provided.
	 */
	@Nullable
	@Override
	public T read() {<FILL_FUNCTION_BODY>}

}

		if (iterator.hasNext())
			return iterator.next();
		else
			return null; // end of data
	
<no_super_class>