@Test
public void testWaitAsync_failed() throws Exception {

    try {
        new ParallelJobsFuture(failedJobFutures(3))
            .waitAsync()
            .join();
        fail("Parallel future must throw exception");
    } catch (CompletionException ex) {
        assert ex.getCause() instanceof JobFailedException;
        JobFailedException cause = (JobFailedException) ex.getCause();
        assertEquals(cause.getSubExceptions().size(), 3);
    }
}