@Test
public void stopAndRepeat() {

    RecordCursor<Integer> cursor = newCursor(i -> i > 2, null, MapWhileCursor.StopContinuation.BEFORE, RecordCursor.NoNextReason.SCAN_LIMIT_REACHED);
    assertEquals(Arrays.asList(2, 3), cursor.asList().join());
    validateNoNextReason(cursor, RecordCursor.NoNextReason.SCAN_LIMIT_REACHED);
    cursor = newCursor(i -> i > 4, cursor.getNext().getContinuation().toBytes(), MapWhileCursor.StopContinuation.BEFORE, RecordCursor.NoNextReason.SCAN_LIMIT_REACHED);
    assertEquals(Arrays.asList(4, 5), cursor.asList().join());
    validateNoNextReason(cursor, RecordCursor.NoNextReason.SCAN_LIMIT_REACHED);
    cursor = newCursor(i -> i > 10, cursor.getNext().getContinuation().toBytes(), MapWhileCursor.StopContinuation.BEFORE, RecordCursor.NoNextReason.SCAN_LIMIT_REACHED);
    assertEquals(Arrays.asList(6), cursor.asList().join());
    validateNoNextReason(cursor, RecordCursor.NoNextReason.SOURCE_EXHAUSTED);
}