public void TestUIntMaxRoundTripSerialization(UInt32 value, UInt32 max)
 {
     for (var i = 0; i < 2; ++i)
     {
         var bw = new BitWriter(32);
         bw.Write(value, max);
         var br = new BitReader(bw.GetBits(0, bw.Length).ToArray());
         var val2 = br.ReadUInt32Max((int)max);
         Assert.AreEqual(value, val2);
         Assert.AreEqual(bw.Length, br.Position);
         value = val2;
     }
 }