gt:       subResult = assertCustom(root.left.left.hasLeftThread, false);
context: /**
  * @Author: Thomas Scholtz <thomas>
  * @Date:   2017-03-04T13:31:50+02:00
  * @Email:  thomas@quantum-sicarius.za.net
  * @Last modified by:   thomas
  * @Last modified time: 2017-03-12T15:59:21+02:00
  * @License: Attribution-NonCommercial-ShareAlike 4.0 International
  */
  
  public class tests_DoubleThreadedBST extends UnitTest{
  
  	public boolean run() {
  
  		boolean result = true;
  		result = result & test_insert_double_threaded_bst("testing insert to double threaded BST");
      result = result & test_threads_double_threaded_bst("testing threads");
      result = result & test_inorderAscending("testing inorderAscending");
      result = result & test_inorderDecending("testing inorderAscending");
      result = result & test_count_left_threads("testing count left threads");
      result = result & test_count_right_threads("testing count right threads");
      result = result & test_count_nodes("testing count of nodes");
      result = result & test_tree_height("testing height of tree");
  		result = result & test_tree_delete("testing delete element");
  		result = result & test_tree_clone("testing clone tree");
  		result = result & test_tree_copy("testing copy tree");
  		return result;
  	}
  
  public boolean test_insert_double_threaded_bst(String title) {
  		// HEADER
  		printHeader(title);
  		boolean result = true;
  		boolean subResult = true;
  		// HEADER END
  
  		// TEST CASE HEADER
  		printSubTest("adding elements to binary tree");
  		subResult = true;
  
  		// TEST AND ASSERT
  		DoubleThreadedBST<Integer> tree = new DoubleThreadedBST<Integer>();
      tree.insert(1);
      tree.insert(2);
      tree.insert(3);
      tree.insert(4);
  
      /*
      1
        \
          2
            \
              3
                \
                  4
      */
      DTNode<Integer> root = tree.getRoot();
      subResult = assertCustom(root.data, 1);
  		subResult = assertCustom(root.right.data, 2);
      subResult = assertCustom(root.right.right.data, 3);
      subResult = assertCustom(root.right.right.right.data, 4);
  
  		// TEST CASE FOOTER
  		result = result & subResult;
  		printSubTestFooter(subResult);
  
  		// TEST CASE HEADER
  		printSubTest("adding the same element again should fail");
  		subResult = true;
  
  		// TEST AND ASSERT
  		subResult = assertCustom(tree.insert(1), false);
      subResult = assertCustom(tree.insert(2), false);
      subResult = assertCustom(tree.insert(3), false);
      subResult = assertCustom(tree.insert(4), false);
  
  		// TEST CASE FOOTER
  		result = result & subResult;
  		printSubTestFooter(subResult);
  
      // TEST CASE HEADER
      printSubTest("adding strange configuration of elements to binary tree");
      subResult = true;
  
      // TEST AND ASSERT
      tree = new DoubleThreadedBST<Integer>();
      tree.insert(5);
      tree.insert(8);
      tree.insert(6);
      tree.insert(2);
      tree.insert(4);
      tree.insert(1);
  
      /*
              5
            /   \
          2       8
        /   \    /
      1       4 6
  
      */
      root = tree.getRoot();
      subResult = assertCustom(root.data, 5);
      subResult = assertCustom(root.right.data, 8);
      subResult = assertCustom(root.right.left.data, 6);
      subResult = assertCustom(root.left.data, 2);
      subResult = assertCustom(root.left.left.data, 1);
      subResult = assertCustom(root.left.right.data, 4);
  
      // TEST CASE FOOTER
      result = result & subResult;
      printSubTestFooter(subResult);
  
  		// FOOTER
  		printFooter(title, result);
  		return result;
  		// FOOTER END
    }
  
    public boolean test_threads_double_threaded_bst(String title) {
    		// HEADER
    		printHeader(title);
    		boolean result = true;
    		boolean subResult = true;
    		// HEADER END
  
    		// TEST CASE HEADER
    		printSubTest("adding elements to binary tree should establish threads [right handed threads]");
    		subResult = true;
  
    		// TEST AND ASSERT
    		DoubleThreadedBST<Integer> tree = new DoubleThreadedBST<Integer>();
        tree.insert(4);
        tree.insert(3);
        tree.insert(2);
        tree.insert(1);
  
        /*
                    4
                  /
                3
              /
            2
          /
        1
        */
        DTNode<Integer> root = tree.getRoot();
        subResult = assertCustom(root.hasRightThread, false);
    		subResult = assertCustom(root.left.hasRightThread, true);
        subResult = assertCustom(root.left.left.hasRightThread, true);
        subResult = assertCustom(root.left.left.left.hasRightThread, true);
  
    		// TEST CASE FOOTER
    		result = result & subResult;
    		printSubTestFooter(subResult);
  
        // TEST CASE HEADER
        printSubTest("adding elements to binary tree should establish threads [left handed threads]");
    		subResult = true;
  
    		// TEST AND ASSERT
    		tree = new DoubleThreadedBST<Integer>();
        tree.insert(1);
        tree.insert(2);
        tree.insert(3);
        tree.insert(4);
  
        /*
        1
          \
            2
              \
                3
                  \
                    4
        */
        root = tree.getRoot();
        subResult = assertCustom(root.hasLeftThread, false);
    		subResult = assertCustom(root.right.hasLeftThread, true);
        subResult = assertCustom(root.right.right.hasLeftThread, true);
        subResult = assertCustom(root.right.right.right.hasLeftThread, true);
  
    		// TEST CASE FOOTER
    		result = result & subResult;
    		printSubTestFooter(subResult);
  
        // TEST CASE HEADER
        printSubTest("adding strange configuration of elements to binary tree [left and right threads]");
        subResult = true;
  
        // TEST AND ASSERT
        tree = new DoubleThreadedBST<Integer>();
        tree.insert(5);
        tree.insert(8);
        tree.insert(6);
        tree.insert(2);
        tree.insert(4);
        tree.insert(1);
  
        /*
                5
              /   \
            2       8
          /   \    /
        1       4 6
  
        */
        // In total:
        // 3 right threads.
        // 2 left threads.
  
        root = tree.getRoot();
        // Node 5 should not have any threads.
        subResult = assertCustom(root.hasRightThread, false);
        subResult = assertCustom(root.hasLeftThread, false);
  
        // Node 8 should not have any threads.
        subResult = assertCustom(root.right.hasRightThread, false);
        subResult = assertCustom(root.right.hasLeftThread, false);
  
        // Node 6 should thread back to 8 [right].
        subResult = assertCustom(root.right.left.hasRightThread, true);
        subResult = assertCustom(root.right.left.right.data, 8);
        // Node 6 should thread back to 5 [left].
        subResult = assertCustom(root.right.left.hasLeftThread, true);
        subResult = assertCustom(root.right.left.left.data, 5);
  
        // Node 2 should not have any threads.
        subResult = assertCustom(root.left.hasRightThread, false);
        subResult = assertCustom(root.left.hasLeftThread, false);
  
        // Node 1 should have thread back to 2 [right].
        subResult = assertCustom(root.left.left.hasRightThread, true);
        subResult = assertCustom(root.left.left.right.data, 2);
        // Node 1 should not have a left thread.
  