public void testFailedStage(){
  CFException ex=new CFException();
  CompletionStage<Integer> f=CompletableFuture.failedStage(ex);
  AtomicInteger x=new AtomicInteger(0);
  AtomicReference<Throwable> r=new AtomicReference<Throwable>();
  f.whenComplete(null);
  assertEquals(x.get(),0);
  assertEquals(r.get(),ex);
}

public void testFailedStage ( ) { CFException ex = new CFException ( ) ; CompletionStage < Integer > f = CompletableFuture . failedStage ( ex ) ; AtomicInteger x = new AtomicInteger ( 0 ) ; AtomicReference < Throwable > r = new AtomicReference < Throwable > ( ) ; f . whenComplete ( null ) ; assertEquals ( x . get ( ) , 0 ) ; assertEquals ( r . get ( ) , ex ) ; }
failedstage returns a completionstage completed exceptionally with the given exception
