final BACKUP_PACKET m1 = Message.BACKUP_PACKET(rand.nextLong(), Arrays.asList(
Message.BACKUP(rand.nextLong(), rand.nextLong(), randomBuffer(100)),
Message.BACKUP(rand.nextLong(), rand.nextLong(), randomBuffer(45)),
Message.BACKUP(rand.nextLong(), rand.nextLong(), randomBuffer(70))));
byte[] array = m1.toByteArray();
final BACKUP_PACKET m2 = (BACKUP_PACKET) Message.fromByteArray(array);
assertThat(m2.getId(), equalTo(m1.getId()));
assertThat(m2.getBackups().size(), equalTo(m1.getBackups().size()));
for (int i = 0; i < m1.getBackups().size(); i++)