public void MaxSumInPerfectTree()
        {
            //TreeNode left = TreeNode.Leaf(-22).WithLeaves(9, 50);
            //TreeNode right = TreeNode.Leaf(11).WithLeaves(9, 2);
            //TreeNode root = TreeNode.Join(5, left, right);

            TreeNode root = new TreeNode
            {
                value = 5,
                left  = new TreeNode
                {
                    value = -22,
                    left  = new TreeNode {
                        value = 9
                    },
                    right = new TreeNode {
                        value = 50
                    }
                },
                right = new TreeNode
                {
                    value = 11,
                    left  = new TreeNode {
                        value = 9
                    },
                    right = new TreeNode {
                        value = 2
                    }
                }
            };

            Assert.AreEqual(33, FunWithTrees_MaxSum_6.MaxSum(root));
        }
        public void MaxSumInNullTree()
        {
            TreeNode root = null;

            Assert.AreEqual(0, FunWithTrees_MaxSum_6.MaxSum(root));
        }