private Map<String, Set<String>> generateInstanceToPartitionsMap(Map<String, Set<String>> partitionToInstances) {
    Map<String, Set<String>> result = new HashMap<>();
    for (Map.Entry<String, Set<String>> entry : partitionToInstances.entrySet()) {
      entry.getValue().forEach(in -> result.computeIfAbsent(in, k -> new HashSet<>()).add(entry.getKey()));
    }
    return result;
  }
Given a map from partition to a set of instances, create reverse map from instances to a set of partitions.
@param partitionToInstances The partition placement map
@return A map from instances to a set of partitions.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixBootstrapUpgradeUtil.java