public void printTriplet(Node head1, Node head2, Node head3,int sum){
        if(head1 == null || head2 == null || head3 == null){
            return;
        }
        
        MergeSortLinkList msll = new MergeSortLinkList();
        head2 = msll.sort(head2, true);
        head3 = msll.sort(head3, false);
        
        while(head1 != null){
            int newSum = sum - head1.data;
            Node tempHead2 = head2;
            Node tempHead3 = head3;
            while(tempHead2 != null && tempHead3 != null){
                if(tempHead2.data + tempHead3.data == newSum){
                    System.out.println(head1.data + " " + tempHead2.data + " " + tempHead3.data);
                    break;
                }
                else if(tempHead2.data + tempHead3.data < newSum){
                    tempHead2 = tempHead2.next;
                }else{
                    tempHead3 = tempHead3.next;
                }
            }
            head1 = head1.next;
        }
    }
http://www.geeksforgeeks.org/find-a-triplet-from-three-linked-lists-with-sum-equal-to-a-given-number/
Test case
empty list
list with 0 1 or more nodes
negative sum
0 sum
positive sum
src/com/interview/linklist/TripletToSumInLinkList.java