docs: public static <T> JavaRDD<T> repartition(JavaRDD<T> rdd, Repartition repartition,
                      RepartitionStrategy repartitionStrategy, int objectsPerPartition, int numPartitions) {
          if (repartition == Repartition.Never)
              return rdd;
  
          switch (repartitionStrategy) {
              case SparkDefault:
                  if (repartition == Repartition.NumPartitionsWorkersDiffers && rdd.partitions().size() == numPartitions)
                      return rdd;
  
                  //Either repartition always, or workers/num partitions differs
                  return rdd.repartition(numPartitions);
              case Balanced:
                  return repartitionBalanceIfRequired(rdd, repartition, objectsPerPartition, numPartitions);
              case ApproximateBalanced:
                  return repartitionApproximateBalance(rdd, repartition, numPartitions);
              default:
                  throw new RuntimeException("Unknown repartition strategy: " + repartitionStrategy);
          }
      }