bool Split(Bucket bucket)
        {
            if (!bucket.CanSplit)
            {
                return(false);//to avoid infinite loop when add same node
            }
            var median = NodeId.Median(bucket.Min, bucket.Max);
            var left   = new Bucket(bucket.Min, median);
            var right  = new Bucket(median, bucket.Max);

            Remove(bucket);
            Add(left);
            Add(right);

            foreach (Node n in bucket.Nodes)
            {
                Add(n, false);
            }

            if (bucket.Replacement != null)
            {
                Add(bucket.Replacement, false);
            }

            return(true);
        }