public void SetBit(int size, int bit)
        {
            var mask = new LogLevelBitMask(size, false, false);

            // check the actual size of the mask in bits
            int effectiveSize = (size + 31) & ~31;

            Assert.Equal(effectiveSize, mask.Size);

            // clear bit
            mask.SetBit(bit);

            // check underlying buffer
            uint[] maskArray        = mask.AsArray();
            int    setBitArrayIndex = bit / 32;
            int    setBitIndex      = bit % 32;

            uint[] expectedMaskArray = new uint[effectiveSize / 32];
            for (int i = 0; i < expectedMaskArray.Length; i++)
            {
                if (i == setBitArrayIndex)
                {
                    expectedMaskArray[i] = 0u | (1u << setBitIndex);
                }
                else
                {
                    expectedMaskArray[i] = 0u;
                }
            }

            Assert.Equal(expectedMaskArray, maskArray);
        }
        public void IsBitSet(int size, int bit)
        {
            var mask = new LogLevelBitMask(size, false, true);

            Assert.False(mask.IsBitSet(bit));
            mask.SetBit(bit);
            Assert.True(mask.IsBitSet(bit));
        }