title: how to assign the return type of completableFuture.supplyAsync() to the object?
body: <p>I have defined completableFuture.supplyAsync() inside foreach loop, so each entry(each asynchronous task) adding a list and I need to get final list(after all asynchronous task adding list)from completableFuture.supplyAsync().How to achieve this? </p>
  
  <p>Code snippet:</p>
  
  <pre><code>    unporcessedList.forEach(entry -&gt; {                       
      CompletableFuture&lt;List&lt;ChangeLog&gt;&gt; cf =  
      CompletableFuture.supplyAsync((Supplier&lt;List&lt;ChangeLog&gt;&gt;) () -&gt; {                            
      mongoDBHelper.processInMongo(entry, getObject(entry, map),entryList);
      return entryList;
      }, executor); 
      });
  </code></pre>