title: CompletableFuture: Waiting for first one normally return?
body: <p>I have some <code>CompletableFuture</code>s and I want to run them in parallel, waiting for the first that returns <strong>normally</strong>.</p>
  
  <p>I know I can use <code>CompletableFuture.anyOf</code> to wait for the first to return, but this will return <strong>normally</strong> or <strong>exceptionally</strong>. I want to ignore exceptions.</p>
  
  <pre><code>List&lt;CompletableFuture&lt;?&gt;&gt; futures = names.stream().map(
    (String name) -&gt;
      CompletableFuture.supplyAsync(
        () -&gt;
          // this calling may throw exceptions.
          new Task(name).run()
      )
  ).collect(Collectors.toList());
  //FIXME Can not ignore exceptionally returned takes.
  Future any = CompletableFuture.anyOf(futures.toArray(new CompletableFuture&lt;?&gt;[]{}));
  try {
      logger.info(any.get().toString());
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>