ResultCursorsHolder { CompletionStage<Throwable> retrieveNotConsumedError() { CompletableFuture<Throwable>[] failures = retrieveAllFailures(); return CompletableFuture.allOf( failures ) .thenApply( ignore -> findFirstFailure( failures ) ); }  void add( CompletionStage<? extends FailableCursor> cursorStage );  }
@Test void shouldReturnNoErrorWhenNoCursorStages() { ResultCursorsHolder holder = new ResultCursorsHolder(); Throwable error = await( holder.retrieveNotConsumedError() ); assertNull( error ); }