### Question:
EnhancedMessageTypeKey extends MessageTypeKey<E> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } @SuppressWarnings("rawtypes") EnhancedMessageTypeKey other = (EnhancedMessageTypeKey) obj; if (msgType2 == null) { if (other.msgType2 != null) { return false; } } else if (!msgType2.getName().equals(other.msgType2.getName())) { return false; } return true; } EnhancedMessageTypeKey(short msgVersion, Class<E> msgType, Class<F> msgType2); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testEquals() { EnhancedMessageTypeKey<?,?> key1; EnhancedMessageTypeKey<?,?> key2; key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class); key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class); Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object())); key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, null); Assert.assertFalse("Wrong equal by msgType2.", key1.equals(key2)); key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class); key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, SetFieldCase.class); Assert.assertFalse("Wrong equal by msgType2 class name.", key1.equals(key2)); }