@Override
    public int hashCode() {
        return msgId.hashCode();
    }
@Test
    public void hashCodeTest() {
        MessageIdImpl msgId1 = new MessageIdImpl(0, 0, 0);
        MessageIdImpl msgId2 = new BatchMessageIdImpl(1, 1, 1, 1);
        TopicMessageIdImpl topicMsgId1 = new TopicMessageIdImpl("topic-partition-1", msgId1);
        TopicMessageIdImpl topic2MsgId1 = new TopicMessageIdImpl("topic2-partition-1", msgId1);
        TopicMessageIdImpl topicMsgId2 = new TopicMessageIdImpl("topic-partition-2", msgId2);

        assertEquals(topicMsgId1.hashCode(), topicMsgId1.hashCode());
        assertEquals(topic2MsgId1.hashCode(), topic2MsgId1.hashCode());
        assertEquals(topicMsgId1.hashCode(), msgId1.hashCode());
        assertNotEquals(topicMsgId1.hashCode(), topicMsgId2.hashCode());
        assertEquals(topicMsgId2.hashCode(), msgId2.hashCode());
    }