title: Check if a value exists in ArrayList
body: <p>How can I check if a value exists in an <code>ArrayList</code>?</p>
  <pre><code>List&lt;CurrentAccount&gt; lista = new ArrayList&lt;CurrentAccount&gt;();
  
  CurrentAccount conta1 = new CurrentAccount(&quot;Alberto Carlos&quot;, 1052);
  CurrentAccount conta2 = new CurrentAccount(&quot;Pedro Fonseca&quot;, 30);
  CurrentAccount conta3 = new CurrentAccount(&quot;Ricardo Vitor&quot;, 1534);
  CurrentAccount conta4 = new CurrentAccount(&quot;João Lopes&quot;, 3135);
  
  lista.add(conta1);
  lista.add(conta2);
  lista.add(conta3);
  lista.add(conta4);
  
  Collections.sort(lista);
  
  System.out.printf(&quot;Bank Accounts:&quot; + &quot;%n&quot;);
  Iterator&lt;CurrentAccount&gt; itr = lista.iterator();
  while (itr.hasNext()) {
      CurrentAccount element = itr.next();
      System.out.printf(element + &quot; &quot; + &quot;%n&quot;);
  }
  System.out.println();
  </code></pre>