title: Accessing the next element in list to compare in Scala
body: <p>I'm new to Scala and i was wondering how you can call the next element of the list because I am trying to compare the current element with the adjacent one. 
  Given x as the current element, I tried similar to java, x+1 but that didnt work. Any help?</p>
  
  <pre><code>for (x &lt;- list; if (x == (next adj. element))) println("same")
  </code></pre>