public Collection<TopicPartition> assignment() {
        return partitions.values().stream()
                .filter(PartitionHistory::isAssigned)
                .map(PartitionHistory::topicPartition)
                .collect(Collectors.toSet());
    }
@return the complete set of partitions currently assigned to this (sink) task
connect/runtime/src/test/java/org/apache/kafka/connect/integration/TaskHandle.java