public void LTCorrectness()
        {
            const int iters = 2000;
            var       dict  = new SortedDictionary <long, long>();
            var       rnd   = new Random();
            var       oi    = new OpfInteger(100);

            for (var i = 0; i < iters; i++)
            {
                var next = (long)((rnd.NextDouble() * 2.0 - 1.0) * long.MaxValue);
                dict[next] = oi.GetBucketId(next);
            }

            var keys = dict.Keys.ToList();

            for (var i = 0; i < keys.Count; i++)
            {
                var item = keys[i];
                var res  = oi.GetBucketsLT(item);

                Assert.Equal(keys.Take(i + 1)
                             .Where(x => oi.GetBucketRange(x).MinValue != item)
                             .Select(x => dict[x])
                             .OrderBy(x => x)
                             .Distinct(),
                             res.OrderBy(x => x));
            }
        }
        public void BucketRangeCorrectness()
        {
            var oi = new OpfInteger(100);

            for (var i = Int64.MinValue; i <= Int64.MinValue + 5000; i++)
            {
                var range = oi.GetBucketRange(i);
                Assert.True(range.MinValue <= i);
                Assert.True(range.MaxValue >= i);
                if (range.MinValue == Int64.MinValue)
                {
                    Assert.True(range.IsFirstBucket);
                    Assert.False(range.IsLastBucket);
                }
                else
                {
                    Assert.False(range.IsFirstBucket);
                    Assert.False(range.IsLastBucket);
                }
            }

            for (var i = -2500; i <= 2500; i++)
            {
                var range = oi.GetBucketRange(i);
                Assert.True(range.MinValue <= i);
                Assert.True(range.MaxValue >= i);
                Assert.False(range.IsFirstBucket);
                Assert.False(range.IsLastBucket);
            }

            for (var i = Int64.MaxValue; i >= Int64.MaxValue - 5000; i--)
            {
                var range = oi.GetBucketRange(i);
                Assert.True(range.MinValue <= i);
                Assert.True(range.MaxValue >= i);
                if (range.MaxValue == Int64.MaxValue)
                {
                    Assert.False(range.IsFirstBucket);
                    Assert.True(range.IsLastBucket);
                }
                else
                {
                    Assert.False(range.IsFirstBucket);
                    Assert.False(range.IsLastBucket);
                }
            }
        }