title: How to compare every objects in iterator with compareTo
body: <p>I have a model <code>class Person</code> which implements the <code>Comparable</code> interface and a <code>compareTo(Personne o)</code> method which returns the proper int depending on the person's age.</p>
  
  <p><strong>Usecase:</strong> I want to check if all the persons inside the collection have the same age with an iterator </p>
  
  <p>What I have so far: </p>
  
  <pre><code>while (collectionOfPerson.hasNext()) {
      Person pers = collectionOfPerson.next();
      if (pers.comparTo(collectionOfPerson.next()) == 0) {
  
      }
  }
  </code></pre>