Skip to content

Instantly share code, notes, and snippets.

@babjo
Created November 26, 2017 15:25
Show Gist options
  • Save babjo/042bc40f7708a5efb42dc5385c0af895 to your computer and use it in GitHub Desktop.
Save babjo/042bc40f7708a5efb42dc5385c0af895 to your computer and use it in GitHub Desktop.
CompletableFuture<String> completableFuture
  = CompletableFuture.supplyAsync(() -> "Hello")
    .thenCompose(s -> CompletableFuture.supplyAsync(() -> s + " World"));
 
assertEquals("Hello World", completableFuture.get());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment