### Question:
CodeKeyMakerFactory { public static CodeKeyMaker createActionsKeyMaker(short version) { return new AbstractCodeKeyMaker(version) { @Override public MessageCodeKey make(ByteBuf input) { int type = input.getUnsignedShort(input.readerIndex()); if (type == EncodeConstants.EXPERIMENTER_VALUE) { Long expId = input.getUnsignedInt(input.readerIndex() + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); return new ExperimenterActionDeserializerKey(getVersion(), expId); } ActionDeserializerKey actionDeserializerKey = new ActionDeserializerKey(getVersion(), type, null); return actionDeserializerKey; } }; } private  CodeKeyMakerFactory(); static CodeKeyMaker createMatchEntriesKeyMaker(short version); static CodeKeyMaker createActionsKeyMaker(short version); static CodeKeyMaker createInstructionsKeyMaker(short version);  }### Answer:
@Test public void testActionKeyMaker() { CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID); Assert.assertNotNull("Null key maker", keyMaker); ByteBuf buffer = BufferHelper.buildBuffer("00 00 00 10 00 00 00 01 00 02 00 00 00 00 00 00"); buffer.skipBytes(4); MessageCodeKey codeKey = keyMaker.make(buffer); Assert.assertNotNull("Null key", codeKey); Assert.assertEquals("Wrong key", new ActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 0, null), codeKey); Assert.assertEquals("Buffer index modified", 16, buffer.readableBytes()); }
@Test public void testExperimenterActionKeyMaker() { CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID); Assert.assertNotNull("Null key maker", keyMaker); ByteBuf buffer = BufferHelper.buildBuffer("FF FF 00 08 00 00 00 01"); buffer.skipBytes(4); MessageCodeKey codeKey = keyMaker.make(buffer); Assert.assertNotNull("Null key", codeKey); Assert.assertEquals("Wrong key", new ActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 65535, 1L), codeKey); Assert.assertEquals("Buffer index modified", 8, buffer.readableBytes()); }