public override void AddRange(int min, int max, int shift)
{
Assert.IsTrue(min >= lower && min <= upper && max >= lower && max <= upper, "min, max should be inside bounds");
if (useBitSet)
for (int i = min; i <= max; i++)
{
Assert.IsFalse(bits.GetAndSet(i - lower), "ranges should not overlap");
// extra exit condition to prevent overflow on MAX_VALUE
if (i == max) break;
}
if (neededBounds == null) return;
// make unsigned ints for easier display and understanding
min ^= unchecked((int) 0x80000000);
max ^= unchecked((int) 0x80000000);
neededShifts.MoveNext();
Assert.AreEqual(((int)neededShifts.Current), shift,"shift");
//System.out.println("new Integer(0x"+Integer.toHexString(min>>>shift)+"),new Integer(0x"+Integer.toHexString(max>>>shift)+"),");
neededBounds.MoveNext();
Assert.AreEqual(((System.Int32) neededBounds.Current), Number.URShift(min, shift), "inner min bound");
neededBounds.MoveNext();
Assert.AreEqual(((System.Int32) neededBounds.Current), Number.URShift(max, shift), "inner max bound");
}
}