title: comparing two generic objects if the one is "greater" or "smaller"
body: <p>I want to generate a binary tree with key - value pairs in their nodes.</p>
  
  <p>In my binary tree I want to implement nodes at the beginning with an <code>insert</code> method, which implements a new left node if the key is smaller than the key of the current node. Then if there is already a left node it will check again for it. The same logic follows for right/greater node inserts. </p>
  
  <p>I wrote my code first using the <code>int</code> type because it's way easier for me to test my code before I use generics (new topic for me). It worked when using <code>int</code> but I an unsure how to compare two generics with themselves by using "&lt;" or ">".</p>
  
  <pre><code>public ListCell&lt;Type&gt; checkKey(Type key, ListCell&lt;Type&gt; checkCell) {
      ListCell&lt;Type&gt; newCell = null;
      if (key &lt; checkCell.key &amp;&amp; checkCell.left != null) {
          ...
      }
      ...
  }
  </code></pre>
  
  <p>I don't know if it's worth saying but I'm creating my binary tree with a selfcoded list.
  Above you can see my current checks but i can't compare my given key now with checkCell.key because of them not being numbers.</p>
  
  <p><strong>So my general question is</strong> how to compare the keys in generics if they are "smaller" or "greater" than the other for my implementation in a binary tree.</p>
  
  <p>Thanks in advance</p>