public boolean hasPartitionsWithAssignmentChanges() {
        for (Entry<Integer, PartitionRegistration> entry : partitionChanges.entrySet()) {
            int partitionId = entry.getKey();
            // New Partition.
            if (!image.partitions().containsKey(partitionId))
                return true;
            PartitionRegistration previousPartition = image.partitions().get(partitionId);
            PartitionRegistration currentPartition = entry.getValue();
            if (!previousPartition.hasSameAssignment(currentPartition))
                return true;
        }
        return false;
    }
Represents changes to a topic in the metadata image.
metadata/src/main/java/org/apache/kafka/image/TopicDelta.java