title: Comparing 2 ArrayList's size and elements continously
body: <p>I would like to know if there is a way for 2 ArrayLists to be compared continuously until their sizes are the same or their elements are the same. The first ArrayList would have a fixed set of elements (let's say 5 elements). The second ArrayList would be empty and with each user interaction an element would be added to the second ArrayList. When the second ArrayList has the same size as the first ArrayList, a comparison is done to see if both arrayLists are the same.</p>
  
  <p>I have gone through a number of ways to do this:</p>
  
  <ol>
  <li><p>I used a nested loop to compare stored and played Items</p>
  
  <pre><code>public int compare(ImageView computer, ImageView player){
  if(player == computer)
      return 1;
  else
      return 2;
  }
  
  
  public void checkMatch(){
      for(int x = 0; x &lt; storedList.size(); x++){
          for(int y = 0; y &lt; playedList.size(); y++){
              result = compare(storedList.get(x), playedList.get(y));
              if(result == 1)
                  //Do stuff
              else
                  //End round
          }
      }
  }
  </code></pre></li>
  <li><p>I then just tried explicitly doing this</p>
  
  <pre><code>if(playedList == storedList)
      //do stuff
  else
      //do stuff
  </code></pre></li>
  <li><p>All of this may work, but I do not know where to call this for the code to actually wait for all the user input to be done completely. Thanks in advance for your help.</p></li>
  </ol>