### Question:
ActionSerializerKey extends MessageTypeKey<Action> 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; } ActionSerializerKey<?> other = (ActionSerializerKey<?>) obj; if (actionType == null) { if (other.actionType != null) { return false; } } else if (!actionType.equals(other.actionType)) { return false; } if (experimenterId == null) { if (other.experimenterId != null) { return false; } } else if (!experimenterId.equals(other.experimenterId)) { return false; } return true; } ActionSerializerKey(short msgVersion, Class<T> actionType,
            Long experimenterId); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testEquals(){ ActionSerializerKey<?> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L); ActionSerializerKey<?> key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 42L); Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal by actionType", key1.equals(key2)); key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L); Assert.assertTrue("Wrong equal by action type", key1.equals(key2)); key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null); Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2)); key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null); Assert.assertTrue("Wrong equal by experimenterId", key1.equals(key2)); }