CompletableFuture<Integer> future = CompletableFuture.supplyAsync(()-> {
return 100;
});
CompletableFuture<String> f = future.thenApplyAsync(i -> i *10).thenApply(i -> i.toString());
System.out.println(f.get()); //"1000"
thenCompose
CompletableFuture<Integer> future =CompletableFuture.supplyAsync(()->{return100;});CompletableFuture<String> f = future.thenCompose( i ->{returnCompletableFuture.supplyAsync(()->{return(i *10)+"";});});System.out.println(f.get());//1000