public boolean isMaxLeafNodeReached() {
        if (maxLeafNodes < 0) {
            // There is no maximum limit
            return false;
        }
        // Count number of child leaf nodes
        int counter = 0;
        for (Node node : getNodes()) {
            if (!node.isCollectionNode()) {
                counter = counter + 1;
            }
        }
        // Compare count with maximum allowed
        return counter >= maxLeafNodes;
    }
Returns true if the max number of leaf nodes associated with this node has
reached to the maximum allowed.

@return true if the max number of leaf nodes associated with this node has
        reached to the maximum allowed.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/CollectionNode.java