Why lambda inside map is not running?
<p>I am trying to learn concurrency and lambdas in java 8. But my code is not entering lambda block inside map. </p>

<pre><code>List&lt;Book&gt; bookList = new ArrayList&lt;Book&gt;();
    isbnList
    .stream()
    .map(isbn -&gt; (CompletableFuture.supplyAsync( () -&gt; {
        try {
            List&lt;String&gt; pageContents = getUrlContents(webLink + isbn);
            return new Book(
                parseBookTitle(pageContents),
                isbn,
                parseRank(pageContents)
            );
        } catch (IOException ex) {
            return null;
        }
    })).thenApply(a -&gt; bookList.add(a))
    );
</code></pre>

<p>While debugging, code is exiting at .map line and I m getting empty bookList. Sequential code for same is giving me correct result.</p>