docs: public static RangeMap<Integer, Set<Integer>> getPartitionGroupsFromTopology(AbstractTopology topo) {
          Set<Integer> visited = new HashSet<>();
          RangeMap<Integer, Set<Integer>> protectionGroups = TreeRangeMap.create();
          for (AbstractTopology.Host host : topo.hostsById.values()) {
              if (visited.contains(host.id) || host.partitions.isEmpty()) {
                  continue;
              }
              Set<Integer> hosts = new HashSet<>();
              @SuppressWarnings("unchecked")
              Range<Integer>[] partitionRange = new Range[1];
              buildProtectionGroup(topo, visited, host, partitionRange, hosts);
              assert hosts.size() * topo.getSitesPerHost() / (topo.getReplicationFactor() + 1) == partitionRange[0].upperEndpoint() - partitionRange[0].lowerEndpoint() + 1;
              protectionGroups.put(partitionRange[0], hosts);
          }
          return protectionGroups;
      }