title: In Stream reduce method, must the identity always be 0 for sum and 1 for multiplication?
body: <p>I proceed with java 8 learning.</p>
  
  <p>I have found an interesting behavior:</p>
  
  <p>let's see code sample: </p>
  
  <pre><code>// identity value and accumulator and combiner
  Integer summaryAge = Person.getPersons().stream()
          //.parallel()  //will return surprising result
          .reduce(1,
                  (intermediateResult, p) -&gt; intermediateResult + p.age,
                  (ir1, ir2) -&gt; ir1 + ir2);
  System.out.println(summaryAge);
  </code></pre>
  
  <p>and model class:</p>
  
  <pre><code>public class Person {
  
      String name;
  
      Integer age;
      ///...
  
      public static Collection&lt;Person&gt; getPersons() {
          List&lt;Person&gt; persons = new ArrayList&lt;&gt;();
          persons.add(new Person("Vasya", 12));
          persons.add(new Person("Petya", 32));
          persons.add(new Person("Serj", 10));
          persons.add(new Person("Onotole", 18));
          return persons;
     }
  }
  </code></pre>
  
  <p><code>12+32+10+18 = 72</code>. For sequential stream, this code always returns <code>73</code> which is <code>72 + 1</code> but for parallel, it always returns <code>76</code> which is <code>72 + 4*1</code> (4 is equal to stream elements count).</p>
  
  <p>When I saw this result I thought that it is strange that parallel stream and sequential streams return different results. </p>
  
  <p>Am I broke contract somewhere?</p>
  
  <h2>P.S.</h2>
  
  <p>for me, 73 is expected result but 76 is not.</p>