title: Returning multiple values with CompletableFuture.supplyAsync
body: <p>I am writing a program to download historical quotes from a source. The source provides files over http for each day which need to be parsed and processed. The program downloads multiple files in parallel using a <code>CompletableFuture</code> using different stages. The first stage is to make a Http call using <code>HttpClient</code> and get the response.</p>
  
  <p>The <code>getHttpResponse()</code> method returns a <code>CloseableHttpResponse</code> Object. I also want to return a url for which this http request was made. Simplest way is to have a wrapper object having these 2 fields, but i feel it is too much to have a class just to contain these 2 fields. Is there a way with <code>CompletableFuture</code> or Streams that I can achieve this?  </p>
  
  <pre><code>  filesToDownload.stream()
                   .map(url -&gt; CompletableFuture.supplyAsync(() -&gt; this.getHttpResponse(url), this.executor) )
                   .map(httpResponseFuture -&gt; httpResponseFuture.thenAccept(t -&gt; processHttpResponse(t)))
                   .count();
  </code></pre>