public static IEnumerable <HierarchyListNode <T> > GetLeafNodes <T>([NotNull] this HierarchyList <T> tree)
 {
     return(tree.Where(a => a.IsLeafNode()));
 }
 public static IEnumerable <HierarchyListNode <T> > GetBranchNodes <T>([NotNull] this HierarchyList <T> tree)
 {
     return(tree.Where(a => TreeNodeExtensions.IsBranchNode <T>(a)));
 }