java generics and extends
<p>I've read the docs but don't see what I'm doing wrong here ...
the goal is a generic collection class Wlist to contain ItemIFs.
The Java source for java.util.TreeMap uses:</p>

<pre><code>public V put(K key, V value) {
  Comparable&lt;? super K&gt; k = (Comparable&lt;? super K&gt;) key;
  cmp = k.compareTo(t.key);
</code></pre>

<p>I was hoping to avoid the cast by using the code below, but
get a warning "unchecked call" when I compile with -Xlint:unchecked.
Suggestions?</p>

<pre><code>interface ItemIF&lt;TP&gt; {
  int compareItem( TP vv);
} // end interface ItemIF


class Wlist&lt;TP extends ItemIF&gt; {
TP coreItem;
void insert( TP item) {
  // *** Following line gets: warning: [unchecked] unchecked call   ***
  // *** to compareItem(TP) as a member of the raw type ItemIF      ***
  int icomp = coreItem.compareItem( item);
}
} // end class


class Item implements ItemIF&lt;Item&gt; {
String stg;
public Item( String stg) {
  this.stg = stg;
}
public int compareItem( Item vv) {
  return stg.compareTo( vv.stg);
}
} // end class Item


class Testit {
public static void main( String[] args) {
  Wlist&lt;Item&gt; bt = new Wlist&lt;Item&gt;();
  bt.insert( new Item("alpha"));
}
} // end class Testit
</code></pre>
