### Question:
RoleRequestInputMessageFactory implements OFSerializer<RoleRequestInput> { @Override public void serialize(RoleRequestInput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeInt(message.getRole().getIntValue()); outBuffer.writeZero(PADDING_IN_ROLE_REQUEST_MESSAGE); outBuffer.writeLong(message.getGenerationId().longValue()); ByteBufUtils.updateOFHeaderLength(outBuffer); }  @Override void serialize(RoleRequestInput message, ByteBuf outBuffer);  }### Answer:
@Test public void testRoleRequestInputMessage() throws Exception { RoleRequestInputBuilder builder = new RoleRequestInputBuilder(); BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID); builder.setRole(ControllerRole.forValue(2)); byte[] generationId = new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}; builder.setGenerationId(new BigInteger(1, generationId)); RoleRequestInput message = builder.build(); ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); roleFactory.serialize(message, out); BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH); Assert.assertEquals("Wrong role", message.getRole().getIntValue(), ControllerRole.forValue((int) out.readUnsignedInt()).getIntValue()); out.skipBytes(PADDING_IN_ROLE_REQUEST_MESSAGE); byte[] genId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; out.readBytes(genId); Assert.assertEquals("Wrong generation ID", message.getGenerationId(), new BigInteger(1, genId)); }