public async Task TestPacketWriteULong()
        {
            const int size = sizeof(ulong);
            const int lastIndex = size - 1;

            var packet = new MutablePacket();
            packet.WriteLong(139L);
            var bytes = packet.Lock();
            Assert.IsTrue(bytes.Length >= size && (bytes[0] == 139 || bytes[lastIndex] == 139), "Failed to write unsigned long integer to packet");
            if (packet.Locked)
            {
                var task = new Task(() => packet.WriteULong(10505L));
                task.Start();
                Assert.IsTrue(await TaskTimesOut(TimeSpan.FromSeconds(2), task), "Packet reported being locked after locking but was still mutable");
            }

            else
            {
                bytes[0] = 145;
                var newBytes = packet.Lock();
                if (newBytes[0] != 139 && newBytes[lastIndex] != 139)
                    Assert.Fail("Packet reported not being locked but the buffer was returned by reference not copy. Return a full copy of the buffer if you wish to unlock else ensure you set the buffer to a locked state when Lock() is called.");
            }
        }