### Question:
TypeToClassKey { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TypeToClassKey other = (TypeToClassKey) obj; if (type != other.type) { return false; } if (version != other.version) { return false; } return true; } TypeToClassKey(short version, int type); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void test(){ final short ver10 = EncodeConstants.OF10_VERSION_ID; final short ver13 = EncodeConstants.OF13_VERSION_ID; final int type1 = 1; final int type2 = 2; TypeToClassKey typeToClsKey10 = new TypeToClassKey(ver10,type1); Assert.assertTrue("Wrong - equals to same object", typeToClsKey10.equals(typeToClsKey10)); Assert.assertFalse("Wrong - equals to null", typeToClsKey10.equals(null)); Assert.assertFalse("Wrong - equals to different class", typeToClsKey10.equals(new Object())); TypeToClassKey typeToClsKey13 = new TypeToClassKey(ver13,type2); Assert.assertFalse("Wrong - equals by different version", typeToClsKey13.equals(new Object())); Assert.assertFalse("Wrong - equals by different type", typeToClsKey13.equals(typeToClsKey10)); }