public void testMultipleRestarts() throws Exception {
getAsItemStream(reader).open(executionContext);
Foo foo1 = reader.read();
getAsItemStream(reader).update(executionContext);
Foo foo2 = reader.read();
Assert.state(!foo2.equals(foo1));
Foo foo3 = reader.read();
Assert.state(!foo2.equals(foo3));
getAsItemStream(reader).close();
// create new input source
reader = createItemReader();
getAsItemStream(reader).open(executionContext);
assertEquals(foo2, reader.read());
assertEquals(foo3, reader.read());
getAsItemStream(reader).update(executionContext);
getAsItemStream(reader).close();
// create new input source
reader = createItemReader();
getAsItemStream(reader).open(executionContext);
Foo foo4 = reader.read();
Foo foo5 = reader.read();
assertEquals(4, foo4.getValue());
assertEquals(5, foo5.getValue());
}