public void MaskedMemCpy_EndToEnd_HasExpectedValueAfterMemMask()
        {
            // see: MaskedMemCpy_MaskedMemCopyTestsData_HasExpectedMask for the prerequisites:
            // --> we got a size of 12 bytes for the test data, 16 byte block size thus 48 byte of mask block data.
            MaskedMemCpy_MaskedMemCopyTestsData_HasExpectedMask(); // adding test here such that it can not get removed accidentally.

            // we generate some test data (24 bytes, which will initially set all padding to zero), and hash it.
            // then we mess up the padding bytes, we hash again which will give a different value. (assert#1)
            // we assert (AssertMemberwiseEqual) that we actually did not change any members (padding is transparent when accessing the members)
            // finally we apply the expected padding mask which should bring back everything to the original state

            const int seed      = 0x72;
            var       testData0 = new MemMaskTestData_Mask
            {
                Offset0 = true,
                Offset4 = 0x19abcdef,
                Offset8 = true
            };

            var testData1 = new MemMaskTestData_Mask
            {
                Offset0 = true,
                Offset4 = 0x01abcdef,
                Offset8 = true
            };

            var mask = Masks.GetMaskView <MemMaskTestData_Mask>();

            using (var _ = new NativeArray <MemMaskTestData_Mask>(2, Allocator.Persistent))
            {
                var data = _;
                data[0] = testData0;
                data[1] = testData1;

                var view = NativeViewUtility.GetReadView(data);
                var h0   = HashUtility.GetDenseHash(view, seed);

                MessUpPaddingBytes(view, mask);

                var h1 = HashUtility.GetDenseHash(view, seed);
                Assert.AreNotEqual(h0, h1);

                AssertMemberwiseEqual(testData0, data[0]);
                AssertMemberwiseEqual(testData1, data[1]);

                MaskedMemCopy.ApplyMask(view, mask);
                Assert.AreEqual(h0, HashUtility.GetDenseHash(view, seed));
            }
        }
 void AssertMemberwiseEqual(MemMaskTestData_Mask expected, MemMaskTestData_Mask actual)
 {
     Assert.AreEqual(expected.Offset0, actual.Offset0);
     Assert.AreEqual(expected.Offset4, actual.Offset4);
     Assert.AreEqual(expected.Offset8, actual.Offset8);
 }