public void removeDuplicates(Node head){
        if(head == null){
            return;
        }
        Node current = head;
        while(current != null && current.next != null){
            if(current.data == current.next.data){
                current.next = current.next.next;
            }else{
                current = current.next;
            }
        }
    }
http://www.geeksforgeeks.org/remove-duplicates-from-a-sorted-linked-list/
Test cases
All duplicates
No duplicates
Duplicates only in starting
Duplicates only at the end
0 1 or more nodes in the list
src/com/interview/linklist/RemoveDuplicatesSortedList.java