### Question:
Futures { public static Throwable completionExceptionCause( Throwable error ) { if ( error instanceof CompletionException ) { return error.getCause(); } return error; } private  Futures(); @SuppressWarnings( "unchecked" ) static CompletableFuture<T> completedWithNull(); static CompletableFuture<T> completeWithNullIfNoError( CompletableFuture<T> future, Throwable error ); static CompletionStage<T> asCompletionStage( io.netty.util.concurrent.Future<T> future ); static CompletionStage<T> asCompletionStage( io.netty.util.concurrent.Future<T> future, CompletableFuture<T> result ); static CompletableFuture<T> failedFuture( Throwable error ); static V blockingGet( CompletionStage<V> stage ); static V blockingGet( CompletionStage<V> stage, Runnable interruptHandler ); static T getNow( CompletionStage<T> stage ); static Throwable completionExceptionCause( Throwable error ); static CompletionException asCompletionException( Throwable error ); static CompletionException combineErrors( Throwable error1, Throwable error2 ); @SuppressWarnings( "ThrowableNotThrown" ) static CompletableFuture<T> onErrorContinue( CompletableFuture<T> future, Throwable errorRecorder,
            Function<Throwable,? extends CompletionStage<T>> onErrorAction );  }### Answer:
@Test void shouldGetCauseFromCompletionException() { RuntimeException error = new RuntimeException( "Hello" ); CompletionException completionException = new CompletionException( error ); assertEquals( error, Futures.completionExceptionCause( completionException ) ); }
@Test void shouldReturnSameExceptionWhenItIsNotCompletionException() { RuntimeException error = new RuntimeException( "Hello" ); assertEquals( error, Futures.completionExceptionCause( error ) ); }