Methods for packing and unpacking messages, tests environment