@Test
public void errorAndLimitInChild() {

    CompletableFuture<Integer> future = new CompletableFuture<>();
    RecordCursor<Integer> cursor = UnorderedUnionCursor.create(Arrays.asList(
            continuation -> RecordCursor.fromList(Arrays.asList(1, 2), continuation).limitRowsTo(1),
            continuation -> RecordCursor.fromFuture(future)
    ), null, null);
    RecordCursorResult<Integer> cursorResult = cursor.getNext();
    assertEquals(1, (int)cursorResult.get());
    CompletableFuture<RecordCursorResult<Integer>> cursorResultFuture = cursor.onNext();
    final RecordCoreException ex = new RecordCoreException("something bad happened!");
    future.completeExceptionally(ex);
    ExecutionException executionException = assertThrows(ExecutionException.class, cursorResultFuture::get);
    assertNotNull(executionException.getCause());
    assertSame(ex, executionException.getCause());
}