Java Tree Debugging
<p>I am trying to implement a method to count all nodes of a tree from the root down. Basically I count the root then add the length of each of the roots child lists. </p>

<pre><code>       public int size() 
       {
            int count = 1; //count the root node
            for (int i = 0; i &lt; root.getChildren().size(); i++){
                count += (root.getChildren().get(i)).length() + 1;
            }
            return count;
        }
</code></pre>

<p>This is the solved solution.</p>
