private void checkValues(TopicPartition deSerTP) {
        //assert deserialized values are same as original
        assertEquals(partNum, deSerTP.partition(), "partition number should be " + partNum + " but got " + deSerTP.partition());
        assertEquals(topicName, deSerTP.topic(), "topic should be " + topicName + " but got " + deSerTP.topic());
    }
This test ensures TopicPartition class is serializable and is serialization compatible.
Note: this ensures that the current code can deserialize data serialized with older versions of the code, but not the reverse.
That is, older code won't necessarily be able to deserialize data serialized with newer code.
clients/src/test/java/org/apache/kafka/common/TopicPartitionTest.java