public void flatten(Node head) {
        Node tail = getTail(head);
        while (head != null) {
            if (head.child != null) {
                tail.next = head.child;
                tail = getTail(tail.next);
                head.child = null;
            }
            head = head.next;
        }
    }
http://www.geeksforgeeks.org/flatten-a-linked-list-with-next-and-child-pointers/
Test case
0 node in the list
1 node in the list
All nodes with child
No nodes with child
src/com/interview/linklist/FlattenLinkList.java