title: how to create broadcast variable in spark 2(java)?
body: <p>In Spark 1 we can use the below code to create a Spark broadcast variable:</p>
  
  <pre><code>SparkConf conf = new SparkConf();
  conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer");
  
  JavaSparkContext sc = new JavaSparkContext("local", "JavaAPISuite", conf);
  
  ArrayList&lt;Strin'valuesg&gt; sampleList = new ArrayList&lt;String&gt;();
  sampleList.add("value");
  
  final Broadcast&lt;ArrayList&lt;String&gt; broadcastVar = sc.broadcast(sampleList);
  </code></pre>
  
  <p>How can we do the same in Spark 2 using the API shown below?</p>
  
  <pre><code>SparkSession sc = SparkSession.setappName("SparkApp").getorcreate();
  sc.sparkcontext().broadcast(T value, scala.reflect.ClassTag&lt;T&gt; evidence$11)
  </code></pre>