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