It represents an async computation that you can compose (`thenApply/thenCompose`) without blocking. A common pitfall is calling `get()/join()` too early (turning it back into blocking code) or forgetting to handle exceptions (`exceptionally/handle`).
CompletableFuture<Integer> result = CompletableFuture
.supplyAsync(() -> 40)
.thenApply(x -> x + 2)
.exceptionally(e -> 0);
System.out.println(result.join());`CompletableFuture` lets you build an async pipeline:
CompletableFuture<User> f = CompletableFuture.supplyAsync(this::loadUser, ioPool)
.thenCompose(user -> CompletableFuture.supplyAsync(() -> loadProfile(user), ioPool))
.exceptionally(ex -> fallbackUser());