private void checkCodec(Codec.CodecRegistration reg, Message message) {
// check a message with its codec
try {
Codec<Message> codec = reg.getCodec();
ByteBuf buffer = codec.encode(Unpooled.buffer(), message);
Message decoded = codec.decode(buffer);
assertEquals("Asymmetry for " + reg.getOpcode() + "/" + message.getClass().getName(), message, decoded);
} catch (IOException e) {
throw new AssertionError("Error in I/O for " + reg.getOpcode() + "/" + message.getClass().getName(), e);
}
}