public int timesAssigned(TopicPartition partition) {
        return partitions.computeIfAbsent(partition, PartitionHistory::new).timesAssigned();
    }
Returns the number of times the partition has been assigned to this (sink) task.
@param partition the partition
@return the number of times it has been assigned; may be 0 if never assigned
connect/runtime/src/test/java/org/apache/kafka/connect/integration/TaskHandle.java