@@ -0,0 +1,1227 @@
+public class PopulatingNextRightPointersinEachNode %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09/*Test#0: Null Test*/%0A%09%09TreeLinkNode nulltest = null;%0A%09%09connect(nulltest);%0A%09%09/*Test#1: Simple Test %7B1,2,3%7D*/%0A%09%09TreeLinkNode rt = new TreeLinkNode(1);%0A%09%09rt.left = new TreeLinkNode(2);%0A%09%09rt.right = new TreeLinkNode(3);%0A%09%09connect(rt);%0A%09%09TreeLinkNode lmc = rt;%0A%09%09TreeLinkNode p = rt;%0A%09%09while(lmc != null)%7B%0A%09%09%09System.out.print(p.val + %22, %22);%0A%09%09%09p = p.next;%0A%09%09%09if(p == null)%7B%0A%09%09%09%09System.out.print(%22#, %22);%0A%09%09%09%09lmc = lmc.left;%0A%09%09%09%09p = lmc;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D%0A%0A%09%7D%0A%0A    public static void connect(TreeLinkNode root) %7B%0A        TreeLinkNode parent = root;%0A        if(parent != null)%7B%0A        %0A%09    %09TreeLinkNode child = parent.left;%0A%09    %09TreeLinkNode leftmostchild = child;%0A%09    %09%0A%09    %09while(leftmostchild != null)%7B%0A%09    %09%09if(child == parent.left)%7B%0A%09    %09%09%09child.next = parent.right;%0A%09    %09%09%09//System.out.println(%22Hello%22);%0A%09    %09%09%7D%0A%09    %09%09else%7B%0A%09    %09%09%09parent = parent.next;%0A%09    %09%09%09if(parent != null)%7B%0A%09    %09%09%09%09child.next = parent.left;%0A%09    %09%09%09%7D%0A%09    %09%09%7D%0A%09    %09%09child = child.next;%0A%09    %09%09%0A%09    %09%09if(child == null)%7B%0A%09    %09%09%09parent = leftmostchild;%0A%09    %09%09%09child = parent.left;%0A%09    %09%09%09leftmostchild = child;%0A%09    %09%09%7D%0A%09    %09%7D%0A        %7D%0A    %7D%0A%7D%0A

Create PopulatingNextRightPointersinEachNode.java