question: public void testRunAfterBoth_sourceCancelled ( ) throws Throwable { for ( ExecutionMode m : ExecutionMode . values ( ) ) for ( boolean mayInterruptIfRunning : new boolean [ ] { true , false } ) for ( boolean fFirst : new boolean [ ] { true , false } ) for ( boolean failFirst : new boolean [ ] { true , false } ) for ( Integer v1 : new Integer [ ] { 1 , null } ) { final CompletableFuture < Integer > f = new CompletableFuture < > ( ) ; final CompletableFuture < Integer > g = new CompletableFuture < > ( ) ; final Noop r1 = new Noop ( m ) ; final Noop r2 = new Noop ( m ) ; final Noop r3 = new Noop ( m ) ; final CompletableFuture < Integer > fst = fFirst ? f : g ; final CompletableFuture < Integer > snd = ! fFirst ? f : g ; final Callable < Boolean > complete1 = failFirst ? null : null ; final Callable < Boolean > complete2 = failFirst ? null : null ; final CompletableFuture < Void > h1 = m . runAfterBoth ( f , g , r1 ) ; assertTrue ( complete1 . call ( ) ) ; final CompletableFuture < Void > h2 = m . runAfterBoth ( f , g , r2 ) ; checkIncomplete ( h1 ) ; checkIncomplete ( h2 ) ; assertTrue ( complete2 . call ( ) ) ; final CompletableFuture < Void > h3 = m . runAfterBoth ( f , g , r3 ) ; checkCompletedWithWrappedCancellationException ( h1 ) ; checkCompletedWithWrappedCancellationException ( h2 ) ; checkCompletedWithWrappedCancellationException ( h3 ) ; r1 . assertNotInvoked ( ) ; r2 . assertNotInvoked ( ) ; r3 . assertNotInvoked ( ) ; checkCompletedNormally ( failFirst ? snd : fst , v1 ) ; checkCancelled ( failFirst ? fst : snd ) ; } }
target:  runAfterBoth result completes exceptionally if either source cancelled