title: Java print TreeMap by ordered values
body: <p>I'm writing a program that stores data about football teams in nested Tree map. It looks like this:</p>
  
  <pre><code>TreeMap&lt;[team name], TreeMap&lt;[team wins], [opponents]&gt;&gt;
  </code></pre>
  
  <p>Where as [team name] and [opponents] are strings and [team wins] is int.
  My current aim is to print the data, by team wins in descending order. It has to look like:</p>
  
  <pre><code>Liverpool: //map key
  wins: &lt;wins&gt;  //nested map key
  opponents: &lt;opponents&gt; 
  </code></pre>
  
  <p>My thought was to order the nested map entrySet() and then iterate it, while printing data, but I couldn't do that, because from what I read I need TreeSet and map.entry() returns just Set.I need my map to be TreeMap, because when two teams have equal wins, I need to print in alphabetical order. If I was unclear, what is a good way to print a TreeMap, sorted by nested TreeMap key?</p>