title: How to combine 3 or more CompletionStages?
body: <p>If have 2 CompletionStages, I can combine them with <code>thenCombine</code> method:</p>
  <pre><code>CompletionStage&lt;A&gt; aCompletionStage = getA();
  CompletionStage&lt;B&gt; bCompletionStage = getB();
  CompletionStage&lt;Combined&gt; combinedCompletionStage =
      aCompletionStage.thenCombine(bCompletionStage, (aData, bData) -&gt; combine(aData, bData));
  </code></pre>
  <p>If I have 3 or more CompletionStages, I can make a chain of <code>thenCombine</code> methods, but I have to use temporary objects to pass results. For example, here is a solution using <code>Pair</code> and <code>Triple</code> from the <code>org.apache.commons.lang3.tuple</code> package:</p>
  <pre><code>CompletionStage&lt;A&gt; aCompletionStage = getA();
  CompletionStage&lt;B&gt; bCompletionStage = getB();
  CompletionStage&lt;C&gt; cCompletionStage = getC();
  CompletionStage&lt;D&gt; dCompletionStage = getD();
  
  CompletionStage&lt;Combined&gt; combinedDataCompletionStage =
          aCompletionStage.thenCombine(bCompletionStage, (Pair::of))
                  .thenCombine(cCompletionStage, (ab, c) -&gt;
                          Triple.of(ab.getLeft(), ab.getRight(), c))
                  .thenCombine(dCompletionStage, (abc, d) -&gt;
                          combine(abc.getLeft(), abc.getMiddle(), abc.getRight(), d));
  </code></pre>
  <p>Is there a better way to combine results from multiple CompletionStages?</p>