### Question:
MatchEntrySerializerKey extends MessageTypeKey<MatchEntry> implements ExperimenterSerializerKey { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } MatchEntrySerializerKey<?, ?> other = (MatchEntrySerializerKey<?, ?>) obj; if (experimenterId == null) { if (other.experimenterId != null) { return false; } } else if (!experimenterId.equals(other.experimenterId)) { return false; } if (oxmClass == null) { if (other.oxmClass != null) { return false; } } else if (!oxmClass.equals(other.oxmClass)) { return false; } if (oxmField == null) { if (other.oxmField != null) { return false; } } else if (!oxmField.equals(other.oxmField)) { return false; } return true; } MatchEntrySerializerKey(short msgVersion, Class<C> oxmClass,
            Class<F> oxmField); void setExperimenterId(Long experimenterId); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testEquals(){ MatchEntrySerializerKey<?, ?> key1; MatchEntrySerializerKey<?, ?> key2; key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class); key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class); Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object())); Long expId1 = 987654331L; Long expId2 = 123456789L; key1.setExperimenterId(null); key2.setExperimenterId(expId2); Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2)); key1.setExperimenterId(expId1); Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2)); key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, null, InPort.class); key1.setExperimenterId(expId2); Assert.assertFalse("Wrong equal by oxmClass", key1.equals(key2)); key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, null, InPort.class); key2.setExperimenterId(expId2); Assert.assertTrue("Wrong equal by oxmClass", key1.equals(key2)); key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, null); key1.setExperimenterId(expId2); Assert.assertFalse("Wrong equal by oxmField", key1.equals(key2)); key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, null); key2.setExperimenterId(expId2); Assert.assertTrue("Wrong equal by oxmField", key1.equals(key2)); }