CompletableFuture, supplyAsync() and thenApply()

It is not the same thing. In the second example where thenApply is not used it is certain that the call to convertToB is executed in the same thread as the method doSomethingAndReturnA. But, in the first example when the thenApply method is used other things can happen. First of all, if the CompletableFuture that … Read more