Spark: find max key in a JavaPairRDD
<p>I have some JavaPairRDD's that look like <code>JavaPairRDD&lt;Integer, Iterable&lt;String&gt;&gt;</code> where <em>Integer</em> is number of occurences of the words contained in the <em>Iterable</em> field.</p>

<p>I'd like to find the JavaPairRDD associated with the maximum key-value.</p>

<p>signature of the JavaRDD max method looks like:</p>

<pre><code>public static T max(java.util.Comparator&lt;T&gt; comp)
</code></pre>

<p>but I don't know how to implement it...</p>