title: Java 8 Stream: How to compare current element with next element?
body: <p>How to get the next element from a <code>List</code> using Java 8 Streams? </p>
  
  <p>If I am iterating over a <code>List</code>, I want to compare current with next element of the list. </p>
  
  <p>Is it doable using Java 8 Stream?</p>