title: Count the occurrences of a char in a string and print them in descending order
body: <p>I need to count how many of occurrences of a char in a string and print them in descending order.
  I can count chars in <code>HashMap</code>, but can't understand how to print map in descending order by values.</p>
  <p>Something like this output:</p>
  <pre><code>String income = &quot;abbccc&quot;;
  
  Output:
  c : 3
  b : 2
  a : 1
  </code></pre>
  <pre><code>import java.util.*;
  
  public class Main {
      public static void main(String[] args) {
          HashMap&lt;Character, Integer&gt; map = new HashMap&lt;&gt;();
          String income = &quot;how are you?&quot;;
  
          int tmp;
  
          for (int i = 0; i &lt; income.length(); i++) {
              if ( map.isEmpty() || !map.containsKey(income.charAt(i)) ) {
                  map.put( income.charAt(i), 1 );
              } else if ( map.containsKey(income.charAt(i)) ) {
                  tmp = map.get( income.charAt(i) );
                  map.replace( income.charAt(i), ++tmp);
              }
          }
  
          for (Map.Entry&lt;Character, Integer&gt; mapTemp: map.entrySet()) {
              System.out.println(mapTemp.getKey() + &quot; &quot; + &quot;:&quot; + &quot; &quot; + mapTemp.getValue());
          }
  }
  }
  </code></pre>
  <pre><code>Output:
    : 2
  a : 1
  r : 1
  e : 1
  u : 1
  w : 1
  h : 1
  y : 1
  o : 2
  ? : 1
  
  Expected (needed) output:
    : 2
  o : 2
  a : 1
  r : 1
  e : 1
  u : 1
  w : 1
  h : 1
  y : 1
  ? : 1
  </code></pre>