/// <summary>Goes through comment tree. If two links are adjacent and there are no others,
        /// add a missing link between them.</summary>
        /// <param name="tree">Comment tree.</param>
        /// <param name="ls">Links storage.</param>
        private void AddMissingLinksBetweenAdjacentOnes(TreeNode <Comment> tree, LinkStorage <TreeNode <Comment> > ls)
        {
            Tuple <TreeNode <Comment>, TreeNode <Comment> >[] allLinks = ls.EnumerateLinks().ToArray();

            foreach (var link in allLinks)
            {
                // Child node of (A - B), B.
                TreeNode <Comment> child = link.Item2;

                // Shouldn't have direct children. No (B - C) links.
                bool hasDirectChildren = ls.GetLinksWithTop(child).Where(z => z.Item1 != z.Item2).Any();
                if (hasDirectChildren)
                {
                    continue;
                }

                // First adjacent link, starting from C, (C - D).
                Tuple <TreeNode <Comment>, TreeNode <Comment> > singleAdjacentLink = child.Children.Select(ls.GetLinksWithTop).SelectMany(a => a).FirstOrDefault();
                if (singleAdjacentLink != null)
                {
                    // OK, create a link between (B - C).
                    // Now we have chain (A - B), (B - C), (C - D).
                    ls.AddLink(child, singleAdjacentLink.Item1);

                    // Is (A - B) actually (B - B)? If so, remove it.
                    if (link.Item1 == link.Item2)
                    {
                        ls.RemoveLink(link.Item1, link.Item2);
                    }
                }
            }
        }
        private void ReSetParentsForContinuousReplies(TreeNode <Comment> tree, LinkStorage <TreeNode <Comment> > ls)
        {
            var allLinksByParent = ls.EnumerateLinks().GroupBy(z => z.Item1);

            foreach (var group in allLinksByParent)
            {
                // (A - B), (A - C).
                Tuple <TreeNode <Comment>, TreeNode <Comment> >[] fromThis = group.ToArray();
                for (int i = 1; i < fromThis.Length; i++)
                {
                    // No (B - ...)?
                    bool previousHasOtherLinks = ls.GetLinksWithTop(fromThis[i - 1].Item2).Any();
                    if (previousHasOtherLinks)
                    {
                        continue;
                    }

                    // Then remove (A - C), set (B - C).
                    ls.RemoveLink(fromThis[i].Item1, fromThis[i].Item2);
                    ls.AddLink(fromThis[i - 1].Item2, fromThis[i].Item2);
                }
            }
        }