update test case order to BST and refactor inserInTree