This should be implemented in JavaRDDLike, like the existing mapPartitions variants without the `preservesPartitioning` argument: https://github.com/eklavya/incubator-spark/blob/master/core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala?pr=%2Fapache%2Fincubator-spark%2Fpull%2F406#L129