title: Java 8 stream - merge collections of objects sharing the same Name and who follow each other
body: <p>Suppose a class Person:</p>
  
  <pre><code>public class Person {
      private String name;
      private int amount;
  }
  </code></pre>
  
  <p>and suppose a collection of Person:</p>
  
  <pre><code>persons = [{"Joe", 5}, {"Joe", 8}, {"Joe", 10}, {"Jack", 3}, {"Jack",6}, {"Joe" 4}, 
             {"Joe", 7}, {"Jack", 12}, {"Jack", 15}, {"Luke", 10}, {"Luke", 12}]
  </code></pre>
  
  <p>What i want is to get list of Person with merged element who have same name and who follow each other and sum the amount (with  java 8 Stream); a list like this:</p>
  
  <pre><code>Perons = [{"Joe", 23}, {"Jack", 9}, {"Joe", 11}, {"Jack", 27}, {"Luke", 22}]
  </code></pre>