### Question:
TypeKeyMakerFactory { public static TypeKeyMaker<Action> createActionKeyMaker(short version) { return new AbstractTypeKeyMaker<Action>(version) { @Override public MessageTypeKey<?> make(Action entry) { if (entry.getExperimenterId() != null) { return new ActionSerializerKey<>(getVersion(), (Class<ActionChoice>) entry.getActionChoice().getImplementedInterface(), entry.getExperimenterId().getValue()); } return new ActionSerializerKey<>(getVersion(), (Class<ActionChoice>) entry.getActionChoice().getImplementedInterface(), null); } }; } private  TypeKeyMakerFactory(); static TypeKeyMaker<MatchEntry> createMatchEntriesKeyMaker(short version); static TypeKeyMaker<Action> createActionKeyMaker(short version); static TypeKeyMaker<Instruction> createInstructionKeyMaker(short version);  }### Answer:
@Test public void testActionKeyMaker() { TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID); Assert.assertNotNull("Null keyMaker", keyMaker); ActionBuilder builder = new ActionBuilder(); builder.setActionChoice(new OutputActionCaseBuilder().build()); Action action = builder.build(); MessageTypeKey<?> key = keyMaker.make(action); Assert.assertNotNull("Null key", key); Assert.assertEquals("Wrong key", new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, OutputActionCase.class, null), key); }
@Test public void testExperimenterActionKeyMaker() { TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID); Assert.assertNotNull("Null keyMaker", keyMaker); org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder(); builder.setExperimenterId(new ExperimenterId(42L)); builder.setActionChoice(new CopyTtlInCaseBuilder().build()); Action action = builder.build(); MessageTypeKey<?> key = keyMaker.make(action); Assert.assertNotNull("Null key", key); Assert.assertEquals("Wrong key", new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, CopyTtlInCase.class, 42L), key); }