If using `numPartitions = partitions`, there is a chance that `p1 == p2 && p1.numPartitions != p2.numPartitions` is true. For example, if `rdd.sample` is empty, `p1 = new RangePartitioner[...](10, rdd, true)`, and `p2 = new RangePartitioner[...](1, rdd, true)`.

That's confusing. So I changed `partitions` to `rangeBounds.length + 1`.