code: public static Cluster
              repeatedlyBalanceContiguousPartitionsPerZone(final Cluster nextCandidateCluster,
                                                           final int maxContiguousPartitionsPerZone) {
          System.out.println("Looping to evenly balance partitions across zones while limiting contiguous partitions");
          // This loop is hard to make definitive. I.e., there are corner cases
          // for small clusters and/or clusters with few partitions for which it
          // may be impossible to achieve tight limits on contiguous run lenghts.
          // Therefore, a constant number of loops are run. Note that once the
          // goal is reached, the loop becomes a no-op.
          int repeatContigBalance = 10;
          Cluster returnCluster = nextCandidateCluster;
          for(int i = 0; i < repeatContigBalance; i++) {
              returnCluster = balanceContiguousPartitionsPerZone(returnCluster,
                                                                 maxContiguousPartitionsPerZone);
  
              returnCluster = balancePrimaryPartitions(returnCluster, false);
              System.out.println("Completed round of balancing contiguous partitions: round "
                                 + (i + 1) + " of " + repeatContigBalance);
          }
  
          return returnCluster;
      }
docs: Loops over cluster and repeatedly tries to break up contiguous runs of
  partitions. After each phase of breaking up contiguous partitions, random
  partitions are selected to move between zones to balance the number of
  partitions in each zone. The second phase may re-introduce contiguous
  partition runs in another zone. Therefore, this overall process is
  repeated multiple times.
  
  @param nextCandidateCluster
  @param maxContiguousPartitionsPerZone See RebalanceCLI.
  @return updated cluster