Skip to content

Instantly share code, notes, and snippets.

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