title: Find the max number of child nodes in tree
body: <p>I am trying to create a method which would return the biggest number of children (child nodes) that any node has. However, my code is incorrectly reading deepers levels.</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  public class Person {
      private String name;
      private List&lt;Person&gt; children = new ArrayList&lt;Person&gt;();
  
  public Person(String name) {
      this.name = name;
  }
  
  public void addChild(Person child) {
      children.add(child);
  }
  
  public int returnMaxChildren() {
      int count = children.size();
      for (Person child : children)
          if (child.children.size() &gt; count)
              count = child.children.size();
      return count;
  }
  </code></pre>