title: Compare two arraylists with iterators
body: <p>I need to compare two different Arraylists of different sizes.</p>
  
  <p>I can do this with two loops - but I need to use iterators.</p>
  
  <p>The second loop only iterates once instead of n times.</p>
  
  <pre><code>while (it.hasNext()) {
      String ID = (String) Order.get(i).ID();
      j = 0;              
      while (o.hasNext()) {   
          String Order = (String) Order.get(j).ID();
          if (myOrder.equals(Order)) {
              //do sth
          }
          j++;
          o.next();
      }
      i++;
      it.next();
  }
  </code></pre>