public static <T>CompletableFuture<T> exceptionalFuture(Throwable t){
  CompletableFuture<T> future=new CompletableFuture<>();
  future.completeExceptionally(t);
  return future;
}

public static < T > CompletableFuture < T > exceptionalFuture ( Throwable t ) { CompletableFuture < T > future = new CompletableFuture < > ( ) ; future . completeExceptionally ( t ) ; return future ; }
creates a future that is synchronously completed exceptionally .
