title: TreeMap Template Framing in Java
body: <p>So, the TreeMap class in java is of the form <code>TreeMap&lt;K,V&gt;</code>. Obviously K needs to be a <code>Combarable</code>, but that is only checked at runtime with a cast, and if it not a <code>Comparable</code> an exception is thrown. Would it not have made more sense to define this class as <code>TreeMap&lt;K extends Comparable&lt;? super K&gt;, V&gt;</code>? </p>
  
  <p>What am I missing here?</p>