### Question:
OF10PortStatusMessageFactory implements OFDeserializer<PortStatusMessage> { @Override public PortStatusMessage deserialize(final ByteBuf rawMessage) { PortStatusMessageBuilder builder = new PortStatusMessageBuilder(); builder.setVersion((short) EncodeConstants.OF10_VERSION_ID); builder.setXid(rawMessage.readUnsignedInt()); builder.setReason(PortReason.forValue(rawMessage.readUnsignedByte())); rawMessage.skipBytes(PADDING_IN_PORT_STATUS_HEADER); deserializePort(rawMessage, builder); return builder.build(); }  @Override PortStatusMessage deserialize(final ByteBuf rawMessage);  }### Answer:
@Test public void test(){ ByteBuf bb = BufferHelper.buildBuffer("00 00 00 00 00 00 00 00 " + "00 10 01 01 05 01 04 02 41 4C 4F 48 41 00 00 00 00 00 00 00 00 00 00 " + "00 00 00 00 15 00 00 00 01 00 00 00 31 00 00 04 42 00 00 03 0C 00 00 08 88"); PortStatusMessage builtByFactory = BufferHelper.deserialize(statusFactory, bb); BufferHelper.checkHeaderV10(builtByFactory); Assert.assertEquals("Wrong reason", PortReason.OFPPRADD, builtByFactory.getReason()); Assert.assertEquals("Wrong port - port-no", 16, builtByFactory.getPortNo().intValue()); Assert.assertEquals("Wrong builtByFactory - hw-addr", new MacAddress("01:01:05:01:04:02"), builtByFactory.getHwAddr()); Assert.assertEquals("Wrong builtByFactory - name", new String("ALOHA"), builtByFactory.getName()); Assert.assertEquals("Wrong builtByFactory - config", new PortConfigV10(true, false, false, true, false, false, true), builtByFactory.getConfigV10()); Assert.assertEquals("Wrong builtByFactory - state", new PortStateV10(false, true, false, false, false, false, true, false), builtByFactory.getStateV10()); Assert.assertEquals("Wrong builtByFactory - curr", new PortFeaturesV10(false, false, false, false, true, true, true, false, false, false, false, false), builtByFactory.getCurrentFeaturesV10()); Assert.assertEquals("Wrong builtByFactory - advertised", new PortFeaturesV10(false, false, true, true, false, false, false, false, false, false, true, false), builtByFactory.getAdvertisedFeaturesV10()); Assert.assertEquals("Wrong builtByFactory - supbuiltByFactoryed", new PortFeaturesV10(true, true, false, false, false, false, false, true, false, true, false, false), builtByFactory.getSupportedFeaturesV10()); Assert.assertEquals("Wrong builtByFactory - peer", new PortFeaturesV10(true, false, false, false, false, false, false, false, true, false, false, true), builtByFactory.getPeerFeaturesV10()); }