Java Snippet
CompletableFuture for Async Workflows
Difficulty: Medium
`CompletableFuture` is Java's promise-style API for composing async work. This snippet covers `supplyAsync` to start a task, `thenApply` for synchronous transforms, `thenCompose` for chaining another async step, and `allOf` to fan out parallel tasks. Use it for any workflow that mixes I/O calls or CPU work without blocking the calling thread.
