The warning message means that in at least one spot, you're using a Collection in the "old" (before 1.5) way:
ArrayList list = new ArrayList();
list.add("foo");
String s = (String) list.get(0);
This is "unsafe" because of that cast. In Java 1.5, you have
generics, which allow you to write this:
ArrayList<String> list = new ArrayList<String>();
list.add("foo");
String s = list.get(0);
Note there is no more cast. Google for "Java generics" to find lots of information on this topic.
As to your second question, the operators you list don't work on Objects, only on numbers, right? So you need Comparators or Comparables to provide ways of comparing Objects.
The integer returned by a Comparator is used by a TreeSet to put objects in order. If the number is positive, one object should come first; if it's negative, then the second should be first. If it's zero, they're the same.