Run in CE (not fiddle)
In abstract tree model, when calling getChildNodes of a target Node, the current process is to retrieve the childNodeCount (the number of all descendant nodes, direct and indirect).
Then, to do a for loop from zero to that count, and fetch the target node getChild at that value.
Since getChild only retrieves direct children (not indirect descendants), this may trigger a lot of calls to getChild() returned with a null value because there is no child at that index.
Assuming the structrure below, getChildNodeCount of A is 6, but only getChild(0) is a useful call.
Review if getChildCount (which returns direct children count only) instead of getChildNodeCount (which returns direct children and also their own descendant count) would be appropriate for TreeModel.
This could affect other implementation than DefaultTreeModel and AbstractTreeModel.
If a change is not warranted, we should update Javadoc to reflect that getChild can be called out of bounds, and need to return null in that case.
Calling a child at an empty index returns Null in DefaultTreeModel, but it might not be clear to developers that TreeModel may call index out of the child collection size when implementing their own tree models.