DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1);
os.writeByte(expected.type().getNumber());
expected.writeFramed(os);
ByteSequence seq = os.toByteSequence();
DataByteArrayInputStream is = new DataByteArrayInputStream(seq);
KahaEntryType type = KahaEntryType.valueOf(is.readByte());
JournalCommand message = (JournalCommand)type.createMessage();
message.mergeFramed(is);
assertEquals(expected, message);
}