public void testToByteArrayFromByteArray() { byte[] byteVal = new byte[] { (byte)0xFF, (byte)0xAB, 0x12, 0x25 }; Identifier identifier1 = Identifier.FromBytes(byteVal, 0, byteVal.Length, false); byte[] bytes = identifier1.ToByteArrayOfSpecifiedEndianness(true); AssertEx.AreEqual("byte array is correct length", bytes.Length, 4); AssertEx.AreEqual("correct string representation", identifier1.ToString(), "0xffab1225"); AssertEx.True("arrays equal", Arrays.Equals(byteVal, bytes)); AssertEx.AreNotSame("arrays are copied", bytes, byteVal); }