title: Spark: How RDD.map/mapToPair work with Java
body: <p>I have some pairs cw (Integer i, String word) with <em>i</em> number of occurences of <em>word</em> in a text file.</p>
  
  <p>I would like to simply have for each pair a new pair c1 (Integer i, 1) with 1 fixed number. </p>
  
  <p>It seems to be really trivial but I haven't understood how map/mapToPair functions actually work.</p>
  
  <pre><code>JavaPairRDD&lt;Integer, Integer&gt; c1 = cw.map(??? -&gt; new Tuple2&lt;Integer, Integer&gt;(??, 1));
  </code></pre>
  
  <p>I am working using Java-8.</p>