Why lambda inside map is not running?
问题 I am trying to learn concurrency and lambdas in java 8. But my code is not entering lambda block inside map. List<Book> bookList = new ArrayList<Book>(); isbnList .stream() .map(isbn -> (CompletableFuture.supplyAsync( () -> { try { List<String> pageContents = getUrlContents(webLink + isbn); return new Book( parseBookTitle(pageContents), isbn, parseRank(pageContents) ); } catch (IOException ex) { return null; } })).thenApply(a -> bookList.add(a)) ); While debugging, code is exiting at .map