Code review for style, clarity and efficiency. Removing duplicates from linkedlist
LinkedList is designed to preserve the order in which elements were inserted into it above all other considerations.  It should only be used when you need to retrieve the items in the list in order, because there is a faster collection available for any other type of access.

It looks from your code like you want a sorted list of elements, in addition to duplicates removed as stated in your question.  Sets are designed to have no duplicates and TreeSet is designed to sort your items as they are inserted.  If you use a TreeSet instead of a LinkedList you don't need a rmDuplicates method at all!  If you are concerned about returning a Set instead of a List, you can always return a Collection because it has about the same signature.  Time the difference between your method and using a TreeSet with a hundred thousand elements.  I think you will be surprised how fast TreeSet is!

public static void main(String[] args) {
    TreeSet&lt;Integer&gt; list = new TreeSet&lt;Integer&gt;();
    list.add(1);
    list.add(1);
    list.add(1);
    list.add(4);
    System.out.println(list);
}


If you needed to preserve the insertion order, I'd use a LinkedHashSet:

public static Collection&lt;Integer&gt; rmDuplicates(Collection&lt;Integer&gt; list) {
    return new LinkedHashSet(list);
}


If you have tried this with a custom type of Object instead of an integer and it didn't work, then you need to implement equals(), hashcode(), and maybe compareTo() properly.