CompositeItemStreamReader implements ItemStreamReader<T> { public void setDelegates(List<ItemStreamReader<T>> delegates) { this.delegates = delegates; }  @Override void open(ExecutionContext executionContext); @Override T read(); @Override void update(ExecutionContext executionContext); @Override void close(); void setDelegates(List<ItemStreamReader<T>> delegates); void setComparator(Comparator<T> comparator); void setSortItems(boolean sortItems);  }
@Test(expected = ItemStreamException.class) public void testReadThrowException() throws Exception { reader.setDelegates(Collections.singletonList(new AbstractItemStreamItemReader<String>() { @Override public String read() throws Exception { throw new Exception(); } })); readAll(); }