### Question:
HelloMessageFactory implements OFSerializer<HelloMessage> { @Override public void serialize(HelloMessage message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); ByteBufUtils.updateOFHeaderLength(outBuffer); }  @Override void serialize(HelloMessage message, ByteBuf outBuffer);  }### Answer:
@Test public void testSerialize() throws Exception { HelloMessageBuilder builder = new HelloMessageBuilder(); BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID); HelloMessage message = builder.build(); ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer(); factory.serialize(message, serializedBuffer); BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 8); }
@Test public void testSerialize() { HelloMessageFactory serializer = new HelloMessageFactory(); SerializerRegistry registry = new NetIdeSerializerRegistryImpl(); registry.init(); ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(message, serializedBuffer); BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 8); }