title: Java8 stream.reduce() with 3 parameters - getting transparency
body: <p>I wrote this code to reduce a list of words to a long count of how many words start with an 'A'.  I'm just writing it to learn Java 8, so I'd like to understand it a little better <em>[Disclaimer: I realize this is probably not the best way to write this code; it's just for practice!]</em>.</p>
  
  <pre><code>Long countOfAWords = results.stream().reduce(
      0L,
      (a, b) -&gt; b.charAt(0) == 'A' ? a + 1 : a,
      Long::sum);
  </code></pre>
  
  <p>The middle parameter/lambda (called the accumulator) would seem to be capable of reducing the full list without the final 'Combiner' parameter.  In fact, the Javadoc actually says:</p>
  
  <blockquote>
    <p>The {@code accumulator} function acts as a fused mapper and
    accumulator,
         * which can sometimes be more efficient than separate mapping and reduction,
         * such as when knowing the previously reduced value allows you to avoid
         * some computation.</p>
  </blockquote>
  
  <p><strong>[Edit From Author] -</strong> The following statement is wrong, so don't let it confuse you; I'm just keeping it here so I don't ruin the original context of the answers.</p>
  
  <p>Anyway, I can infer that the accumulator must just be outputting 1's and 0's which the combiner combines.  I didn't find this particularly obvious from the documentation though.</p>
  
  <p><strong>My Question</strong></p>
  
  <p>Is there a way to see what the output would be before the combiner executes so I can see the list of 1's and 0's that the combiner combines?  This would be helpful in debugging more complex situations which I'm sure I'll come across eventually.</p>