@Test(expected=IllegalStateException.class)
public void test_RS_peeking_8() {
// Peeking may fail if someone moves backwards in the result set
// If we had moved past the first item this should be an error
ResultSetRewindable inner = new ResultSetMem(make("x", NodeFactory.createURI("tag:local")), make("x", NodeFactory.createURI("tag:local")));
ResultSetPeekable rs = ResultSetFactory.makePeekable(inner);
assertTrue(rs.hasNext());
assertNotNull(rs.peek());
assertNotNull(rs.next());
// Reset the inner result set independently
inner.reset();
// Since we moved the underlying result set backwards and had moved somewhere we
// are now in an illegal state
rs.hasNext();
}