title: Search in ArrayList
body: <p>I have 2 ArrayLists that have a Array of Strings as a "component". I want to find the "components" whose first element is the same in both ArrayLists.
  To be more clear:</p>
  
  <pre><code>ArrayList One
  first component =&gt; {"0", "zero"}
  second component =&gt; {"1", "one"}
  ArrayList Two
  first component =&gt; {"1", "uno"}
  second component =&gt; {"2", "two"}
  </code></pre>
  
  <p>I would like to loop through ArrayList Two and find {"1","uno"}.
  So far I have a nested loop that loops through the first array and then checks the current component to each component in ArrayList Two. </p>
  
  <pre><code>    for(int i=0; i&lt;One.size(); i++)
      {
          for(int j=0; j&lt;Two.size(); j++)
          {
              if( fileOne.get(i)[0].equals( Two.get(j)[0] ) )
              {
                  System.out.print( Two.get(j)[0]+" " );
                  System.out.print( Two.get(j)[1] );
                  System.out.println();
              }
          }
      }
  </code></pre>
  
  <p>I think there should be a better solution. Any help</p>