title: My foreach-loop doesn't work
body: <p>This method is supposed to return the object most popular friend. I though that this loop would add a object with a <code>getFriend().size() &gt; 0</code> in an arraylist. Then it would compare the next objects <code>getFriend().size()</code> with the object which is in the ArrayList. The object would get added to the ArrayList, while the other object gets removed, if it have more friends. </p>
  
  <pre><code>// Class variables
  
  // the person's name
  private String name;
  // a list of this person's friends
  private ArrayList&lt;Person&gt; friends; 
  
  public Person mostConnectedFriend(){
      for(Person f : friends){
          ArrayList&lt;Integer&gt; mostFriends = new ArrayList&lt;&gt;(); 
          int amountOfFriends = 0;
          if(getFriends().size() &gt; amountOfFriends){
              mostFriends.remove(amountOfFriends);
              mostFriends.add(amountOfFriends);
          }
      } return null;
  }    
  </code></pre>