static Map<String, List<Integer>> getInverseMap(Map<Integer, String> brokerRackMap) {
        Map<String, List<Integer>> results = new HashMap<>();
        brokerRackMap.forEach((id, rack) -> results.computeIfAbsent(rack, key -> new ArrayList<>()).add(id));
        results.forEach((rack, rackAndIdList) -> rackAndIdList.sort(Integer::compareTo));
        return results;
    }
Given broker and rack information, returns a list of brokers alternated by the rack. Assume
this is the rack and its brokers:
<pre>
rack1: 0, 1, 2
rack2: 3, 4, 5
rack3: 6, 7, 8
</pre>
This API would return the list of 0, 3, 6, 1, 4, 7, 2, 5, 8
<br>
This is essential to make sure that the assignReplicasToBrokers API can use such list and
assign replicas to brokers in a simple round-robin fashion, while ensuring an even
distribution of leader and replica counts on each broker and that replicas are
distributed to all racks.
server-common/src/main/java/org/apache/kafka/admin/AdminUtils.java