public static void main(String args[]){
        LinkList ll = new LinkList();
        Node head = null;
        head = ll.addNode(1, head);
        head = ll.addNode(1, head);
        head = ll.addNode(1, head);
        head = ll.addNode(4, head);
        head = ll.addNode(4, head);
        head = ll.addNode(5, head);
        head = ll.addNode(6, head);
        head = ll.addNode(6, head);
        head = ll.addNode(6, head);
        RemoveDuplicatesSortedList rds = new RemoveDuplicatesSortedList();
        rds.removeDuplicates(head);
        ll.printList(head);
    }
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