### Question:
GroupModInputMessageFactory implements OFDeserializer<GroupModInput>, DeserializerRegistryInjector { @Override public GroupModInput deserialize(ByteBuf rawMessage) { GroupModInputBuilder builder = new GroupModInputBuilder(); builder.setVersion((short) EncodeConstants.OF13_VERSION_ID); builder.setXid(rawMessage.readUnsignedInt()); builder.setCommand(GroupModCommand.forValue(rawMessage.readUnsignedShort())); builder.setType(GroupType.forValue(rawMessage.readUnsignedByte())); rawMessage.skipBytes(PADDING); builder.setGroupId(new GroupId(rawMessage.readUnsignedInt())); List<BucketsList> bucketsList = new ArrayList<>(); while (rawMessage.readableBytes() > 0) { BucketsListBuilder bucketsBuilder = new BucketsListBuilder(); int bucketsLength = rawMessage.readUnsignedShort(); bucketsBuilder.setWeight(rawMessage.readUnsignedShort()); bucketsBuilder.setWatchPort(new PortNumber(rawMessage.readUnsignedInt())); bucketsBuilder.setWatchGroup(rawMessage.readUnsignedInt()); rawMessage.skipBytes(PADDING_IN_BUCKETS_HEADER); CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID); List<Action> actions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID, bucketsLength - BUCKETS_HEADER_LENGTH, rawMessage, keyMaker, registry); bucketsBuilder.setAction(actions); bucketsList.add(bucketsBuilder.build()); } builder.setBucketsList(bucketsList); return builder.build(); }  @Override void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry); @Override GroupModInput deserialize(ByteBuf rawMessage);  }### Answer:
@Test public void test() { ByteBuf bb = BufferHelper .buildBuffer("00 02 03 00 00 00 01 00 00 10 00 0a 00 " + "00 00 41 00 00 00 16 00 00 00 00"); GroupModInput deserializedMessage = BufferHelper.deserialize(factory, bb); BufferHelper.checkHeaderV13(deserializedMessage); Assert.assertEquals("Wrong command", GroupModCommand.forValue(2), deserializedMessage.getCommand()); Assert.assertEquals("Wrong type", GroupType.forValue(3), deserializedMessage.getType()); Assert.assertEquals("Wrong group id", new GroupId(256L), deserializedMessage.getGroupId()); BucketsList bucket = deserializedMessage.getBucketsList().get(0); Assert.assertEquals("Wrong weight", 10, bucket.getWeight().intValue()); Assert.assertEquals("Wrong watch port", new PortNumber(65L), bucket.getWatchPort()); Assert.assertEquals("Wrong watch group", 22L, bucket.getWatchGroup().longValue()); }