public int size() {
        if (childNodes != null) {
            int childNodesSize = 0;
            for (HierarchyTreeNode childNode : childNodes) {
                childNodesSize += childNode.size();
            }
            return 1 + childNodesSize;
        } else
            return 1;
    }