title: Checking through an arraylist and return a boolean result
body: <p>I'm facing a problem whereby <code>retrieveLoginData()</code> is always returning <code>false</code>
  How do I make it so that it returns the value of my <code>if-else-statement</code>? Thanks a lot!</p>
  
  <pre><code>private ArrayList&lt;String&gt; login = new ArrayList&lt;String&gt;();
  
      public boolean retrieveLoginData(LoginRecord lr) {
  
      for (int i = 0; i &lt; login.size(); i++) {
  
          if (lr.getLoginName().equals(login.get(i)))
  
      return true;}// There's a duplicate in the arraylist
      return false; // Returns false if there are no duplicates
  </code></pre>
  
  <p>}</p>