import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.mllib.classification.SVMModel;
import org.apache.spark.mllib.classification.SVMWithSGD;
import org.apache.spark.mllib.linalg.Vector;
import org.apache.spark.mllib.linalg.Vectors;
import org.apache.spark.mllib.regression.LabeledPoint;
import org.apache.spark.mllib.tree.model.RandomForestModel;
import org.apache.spark.mllib.tree.RandomForest;


import java.util.HashMap;
import java.util.regex.Pattern;

public final class RandomForestMP {

    public static void main(String[] args) {
        if (args.length < 3) {
            System.err.println(
                    "Usage: RandomForestMP <training_data> <test_data> <results>");
            System.exit(1);
        }
        String training_data_path = args[0];
        String test_data_path = args[1];
        String results_path = args[2];

        SparkConf sparkConf = new SparkConf().setAppName("RandomForestMP");
        JavaSparkContext sc = new JavaSparkContext(sparkConf);
        final RandomForestModel model;

        Integer numClasses = 2;
        HashMap<Integer, Integer> categoricalFeaturesInfo = new HashMap<Integer, Integer>();
        Integer numTrees = 3;
        String featureSubsetStrategy = "auto";
        String impurity = "gini";
        Integer maxDepth = 5;
        Integer maxBins = 32;
        Integer seed = 12345;

		// TODO

        JavaRDD<LabeledPoint> results = test.map(new Function<Vector, LabeledPoint>() {
            public LabeledPoint call(Vector points) {
                return new LabeledPoint(model.predict(points), points);
            }
        });

        results.saveAsTextFile(results_path);

        sc.stop();
    }

}

@@ -69,541 +69,107 @@
 Java
-RDD;%0Aimport org.apache.spark.api.java.JavaSparkContext;%0Aimport org.apache.spark.api.java.function.Function;%0Aimport org.apache.spark.mllib.classification.SVMModel;%0Aimport org.apache.spark.mllib.classification.SVMWithSGD;%0Aimport org.apache.spark.mllib.linalg.Vector;%0Aimport org.apache.spark.mllib.linalg.Vectors;%0Aimport org.apache.spark.mllib.regression.LabeledPoint;%0Aimport org.apache.spark.mllib.tree.model.RandomForestModel;%0Aimport org.apache.spark.mllib.tree.RandomForest;%0A%0A%0Aimport java.util.HashMap;%0Aimport java.util.regex.Pattern
+SparkContext;%0Aimport org.apache.spark.mllib.tree.model.RandomForestModel;%0A%0Aimport java.util.HashMap
 ;%0A%0Ap
@@ -1070,10 +1070,16 @@
 5;%0A%0A
-%09%09
+        
 // T
@@ -1083,16 +1083,18 @@
 / TODO%0A%0A
+//
         
@@ -1169,24 +1169,26 @@
 dPoint%3E() %7B%0A
+//
             
@@ -1225,24 +1225,26 @@
 r points) %7B%0A
+//
             
@@ -1303,16 +1303,18 @@
 oints);%0A
+//
         
@@ -1311,32 +1311,34 @@
 //            %7D%0A
+//
         %7D);%0A%0A   
@@ -1330,24 +1330,26 @@
        %7D);%0A%0A
+//
         resu

make it compile