### Question:
OF10FlowRemovedMessageFactory implements OFDeserializer<FlowRemovedMessage>,
        DeserializerRegistryInjector { @Override public FlowRemovedMessage deserialize(ByteBuf rawMessage) { FlowRemovedMessageBuilder builder = new FlowRemovedMessageBuilder(); builder.setVersion((short) EncodeConstants.OF10_VERSION_ID); builder.setXid(rawMessage.readUnsignedInt()); OFDeserializer<MatchV10> matchDeserializer = registry.getDeserializer( new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, EncodeConstants.EMPTY_VALUE, MatchV10.class)); builder.setMatchV10(matchDeserializer.deserialize(rawMessage)); byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; rawMessage.readBytes(cookie); builder.setCookie(new BigInteger(1, cookie)); builder.setPriority(rawMessage.readUnsignedShort()); builder.setReason(FlowRemovedReason.forValue(rawMessage.readUnsignedByte())); rawMessage.skipBytes(PADDING_IN_FLOW_REMOVED_MESSAGE); builder.setDurationSec(rawMessage.readUnsignedInt()); builder.setDurationNsec(rawMessage.readUnsignedInt()); builder.setIdleTimeout(rawMessage.readUnsignedShort()); rawMessage.skipBytes(PADDING_IN_FLOW_REMOVED_MESSAGE_2); byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; rawMessage.readBytes(packetCount); builder.setPacketCount(new BigInteger(1, packetCount)); byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; rawMessage.readBytes(byteCount); builder.setByteCount(new BigInteger(1, byteCount)); return builder.build(); }  @Override FlowRemovedMessage deserialize(ByteBuf rawMessage); @Override void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry);  }### Answer:
@Test public void test(){ ByteBuf bb = BufferHelper.buildBuffer("00 24 08 D1 00 20 AA BB CC DD EE FF " + "AA BB CC DD EE FF 00 05 10 00 00 08 07 06 00 00 10 11 12 13 01 02 03 04 " + "50 50 20 20 " + "00 01 02 03 04 05 06 07 00 03 01 00 00 00 00 02 " + "00 00 00 05 00 08 00 00 00 01 02 03 04 05 06 07 00 01 02 03 04 05 06 07"); FlowRemovedMessage builtByFactory = BufferHelper.deserialize(flowFactory, bb); BufferHelper.checkHeaderV10(builtByFactory); Assert.assertEquals("Wrong cookie", 0x0001020304050607L, builtByFactory.getCookie().longValue()); Assert.assertEquals("Wrong priority", 0x03, builtByFactory.getPriority().intValue()); Assert.assertEquals("Wrong reason", 0x01, builtByFactory.getReason().getIntValue()); Assert.assertEquals("Wrong durationSec", 0x00000002L, builtByFactory.getDurationSec().longValue()); Assert.assertEquals("Wrong durationNsec", 0x00000005L, builtByFactory.getDurationNsec().longValue()); Assert.assertEquals("Wrong idleTimeout", 0x08, builtByFactory.getIdleTimeout().intValue()); Assert.assertEquals("Wrong packetCount", 0x0001020304050607L, builtByFactory.getPacketCount().longValue()); Assert.assertEquals("Wrong byteCount", 0x0001020304050607L, builtByFactory.getByteCount().longValue()); }