title: join CompletableFuture vs synchronous method
body: <p>Having:</p>
  
  <pre><code>String getData(String key){
      // Slow operation
  }
  
  CompletableFuture&lt;String&gt; getDataAsync(String key){
      return CompletableFuture.supplyAsync(() -&gt; getData(key));
  }
  </code></pre>
  
  <p>What is the difference between the following?</p>
  
  <p><strong>a)</strong></p>
  
  <pre><code>keyStream.map(key -&gt; getData(key));
  </code></pre>
  
  <p><strong>b)</strong></p>
  
  <pre><code>keyStream.map(key -&gt; getDataAsync(key).join());
  </code></pre>
  
  <p>Is there any advantage to use async in this case?</p>