### Question:
FeaturesReplyMessageFactory implements OFDeserializer<GetFeaturesOutput> { @Override public GetFeaturesOutput deserialize(ByteBuf rawMessage) { GetFeaturesOutputBuilder builder = new GetFeaturesOutputBuilder(); builder.setVersion((short) EncodeConstants.OF13_VERSION_ID); builder.setXid(rawMessage.readUnsignedInt()); byte[] datapathId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; rawMessage.readBytes(datapathId); builder.setDatapathId(new BigInteger(1, datapathId)); builder.setBuffers(rawMessage.readUnsignedInt()); builder.setTables(rawMessage.readUnsignedByte()); builder.setAuxiliaryId(rawMessage.readUnsignedByte()); rawMessage.skipBytes(PADDING_IN_FEATURES_REPLY_HEADER); builder.setCapabilities(createCapabilities(rawMessage.readUnsignedInt())); builder.setReserved(rawMessage.readUnsignedInt()); return builder.build(); }  @Override GetFeaturesOutput deserialize(ByteBuf rawMessage);  }### Answer:
@Test public void test() { ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 04 05 06 07 00 01 02 03 01 01 00 00 00" + " 00 00 00 00 01 02 03"); GetFeaturesOutput builtByFactory = BufferHelper.deserialize(featuresFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong datapathId", 0x0001020304050607L, builtByFactory.getDatapathId().longValue()); Assert.assertEquals("Wrong buffers", 0x00010203L, builtByFactory.getBuffers().longValue()); Assert.assertEquals("Wrong number of tables", 0x01, builtByFactory.getTables().shortValue()); Assert.assertEquals("Wrong auxiliaryId", 0x01, builtByFactory.getAuxiliaryId().shortValue()); Assert.assertEquals("Wrong capabilities", new Capabilities(false, false, false, false, false, false, false), builtByFactory.getCapabilities()); Assert.assertEquals("Wrong reserved", 0x00010203L, builtByFactory.getReserved().longValue()); }
@Test public void testCapabilities() { ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 04 05 06 07 00 01 02 03 01 01 00 00 00" + " 00 01 6F 00 01 02 03"); GetFeaturesOutput builtByFactory = BufferHelper.deserialize(featuresFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong capabilities", new Capabilities(true, true, true, true, true, true, true), builtByFactory.getCapabilities()); }