/**
 * Illustrates a simple map in Java
 */
package com.oreilly.learningsparkexamples.java;

import java.util.Arrays;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;

public class BasicMap {
  public static void main(String[] args) throws Exception {
		String master;
		if (args.length > 0) {
      master = args[0];
		} else {
			master = "local";
		}
		JavaSparkContext sc = new JavaSparkContext(
      master, "basicmap", System.getenv("SPARK_HOME"), System.getenv("JARS"));
    JavaRDD<Integer> rdd = sc.parallelize(Arrays.asList(1, 2, 3, 4));
    JavaRDD<Integer> result = rdd.map(
      new Function<Integer, Integer>() { public Integer call(Integer x) { return x*x;}});
    System.out.println(StringUtils.join(result.collect(), ","));
	}
}

@@ -410,18 +410,20 @@
 ption %7B%0A
-%09%09
+    
 String m
@@ -429,18 +429,20 @@
 master;%0A
-%09%09
+    
 if (args
@@ -480,18 +480,20 @@
 rgs%5B0%5D;%0A
-%09%09
+    
 %7D else %7B
@@ -497,11 +497,14 @@
 e %7B%0A
-%09%09%09
+      
 mast
@@ -521,14 +521,18 @@
 l%22;%0A
-%09%09%7D%0A%09%09
+    %7D%0A    
 Java
@@ -918,9 +918,10 @@
 ));%0A
-%09
+  
 %7D%0A%7D%0A

Fix random indentation in BasicMap