Spark-615: make mapPartitionsWithIndex callable from java