Sort a list by frequency of strings in it
<p>List is</p>

<pre><code>List&lt;String&gt; list = new ArrayList&lt;String&gt;();

list.add("apple");
list.add("ball");
list.add("apple");
list.add("cat");
list.add("ball");
</code></pre>

<p>Now I have to sort this list with frequency of the apple, ball, cat</p>

<p>I have to get output as:</p>

<pre><code>apple
ball
cat
</code></pre>
