CompositeItemStreamReader implements ItemStreamReader<T> { public void setSortItems(boolean sortItems) { this.sortItems = sortItems; }  @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 public void testReadWithoutSorting() throws Exception { List<String> expected = Arrays.asList("a", "e", "i", "b", "f", "j", "c", "g", "k", "d", "h", "l"); reader.setSortItems(false); Assert.assertEquals(expected, readAll()); }