static int compareTopicPartitionReplicas(TopicPartitionReplica a, TopicPartitionReplica b) {
        int brokerOrder =  Integer.compare(a.brokerId(), b.brokerId());

        if (brokerOrder != 0)
            return brokerOrder;

        int topicOrder = Objects.compare(a.topic(), b.topic(), String::compareTo);
        return topicOrder == 0 ? Integer.compare(a.partition(), b.partition()) : topicOrder;
    }
Verify the partition reassignments specified by the user.

@param adminClient           The AdminClient to use.
@param targets               The partition reassignments specified by the user.

@return                      A tuple of the partition reassignment states, and a
                             boolean which is true if there are no ongoing
                             reassignments (including reassignments not described
                             in the JSON file.)
tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java