title: Java "unchecked call to compareTo(T) as a member of the raw type java.lang.Comparable"
body: <p>I'm trying to implement a sorted list as a simple exercise in Java. To make it generic I have an <code>add(Comparable obj)</code> so I can use it with any class that implements the Comparable interface.</p>
  
  <p>But, when I use <code>obj.compareTo(...)</code> anywhere in the code I get <code>"unchecked call to compareTo(T) as a member of the raw type java.lang.Comparable"</code> from the compiler (with <code>-Xlint:unchecked</code> option). The code works just fine but I can't figure out how to get rid of that annoying message.</p>
  
  <p>Any hints?</p>