package com.fishercoder;

import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.CommonUtils;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions._94;
import org.junit.BeforeClass;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

public class _94Test {
    private static _94.Solution1 solution1;
    private static TreeNode root;
    private static List<Integer> inorder;

    @BeforeClass
    public static void setup() {
        solution1 = new _94.Solution1();
    }

    @Test
    public void test1() {
        root = TreeUtils.constructBinaryTree(Arrays.asList(3, 1, null, null, 5, 2, null, null, 4));
        inorder = solution1.inorderTraversal(root);
        CommonUtils.printList(inorder);
    }

    @Test
    public void test2() {
        root = TreeUtils.constructBinaryTree(Arrays.asList(1, 2, 3, 4, null, 5, 6, null, 7, null, null, null, null, 8, 9));
        TreeUtils.printBinaryTree(root);
        inorder = solution1.inorderTraversal(root);
        CommonUtils.printList(inorder);
    }

}

@@ -371,16 +371,60 @@
 ution1;%0A
+    private static _94.Solution2 solution2;%0A
     priv
@@ -449,16 +449,16 @@
 e root;%0A
-
     priv
@@ -583,16 +583,57 @@
 ion1();%0A
+        solution2 = new _94.Solution2();%0A
     %7D%0A%0A 
@@ -1059,32 +1059,32 @@
 naryTree(root);%0A
-
         inorder 
@@ -1166,10 +1166,283 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void test3() %7B%0A        root = TreeUtils.constructBinaryTree(Arrays.asList(1, 2, 3, 4, null, 5, null, null, 6));%0A        TreeUtils.printBinaryTree(root);%0A        inorder = solution2.inorderTraversal(root);%0A        CommonUtils.printList(inorder);%0A    %7D%0A%0A
 %7D%0A

add a test for 94