title: Compare 2 keys in Java HashMap
body: <p>I've made a <code>BinaryTree&lt; HashMap&lt;String, String&gt; &gt;.</code></p>
  
  <p>How can I compare the two keys so I can correctly insert the two elements (HashMaps) into  the ordered BinaryTree?
  Here's what I've got so far:</p>
  
  <pre><code>public class MyMap&lt;K extends Comparable&lt;K&gt;, V&gt; extends HashMap&lt;K, V&gt; implements Comparable&lt; MyMap&lt;K, V&gt; &gt;
  {
  
      @override
      public int compareTo(MyMap&lt;K, V&gt; mapTwo)
      {
          if ( (this.keySet().equals(mapTwo.keySet())) ) return 0;
          //How can I check for greater than/less than and keep my generics?  
  
      }
  </code></pre>
  
  <p><strong>EDIT:</strong> There is only one key in each HashMap (it's a very simple language translation system), so sorting the keys shouldn't be necessary.  I would have liked to use the <code>String.compareTo()</code> method, but because of my generics, the compiler doesn't know that <code>K</code> is a <code>String</code></p>