CompletableFuture future = supplyAsync(()-> 4); future.thenApplyAsync(data -> doSomeHeavyTask() .thenApplyAsync(data -> doSomeLiteTask