### Question:
BinarySearchTreeResolver { public static boolean isBinarySearchTree(BinaryTree tree) { if (tree == null) { throw new IllegalArgumentException("Input binary tree is null"); } if (tree.left != null) { int lValue = max(tree.left); if (lValue >= tree.value) { return false; } } if (tree.right != null) { int rValue = min(tree.right); if (rValue < tree.value) { return false; } } return true; }  static boolean isBinarySearchTree(BinaryTree tree);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testIsBinarySearchTree1() { isBinarySearchTree(null); }
@Test public void testIsBinarySearchTree2() { BinaryTree treeLevel0 = new BinaryTree(null, null, 0); assertThat("This binary tree should be BST", isBinarySearchTree(treeLevel0), is(true)); }
@Test public void testIsBinarySearchTree3() { BinaryTree treeLevel10 = new BinaryTree(null, null, -1); BinaryTree treeLevel11 = new BinaryTree(null, null, 5); BinaryTree treeLevel0 = new BinaryTree(treeLevel10, treeLevel11, 0); assertThat("This binary tree should be BST", isBinarySearchTree(treeLevel0), is(true)); }
@Test public void testIsBinarySearchTree4() { BinaryTree treeLevel20 = new BinaryTree(-10); BinaryTree treeLevel21 = new BinaryTree(3); BinaryTree treeLevel22 = new BinaryTree(12); BinaryTree treeLevel10 = new BinaryTree(treeLevel20, null, -1); BinaryTree treeLevel11 = new BinaryTree(treeLevel21, treeLevel22, 5); BinaryTree treeLevel0 = new BinaryTree(treeLevel10, treeLevel11, 0); assertThat("This binary tree should be BST", isBinarySearchTree(treeLevel0), is(true)); }
@Test public void testIsBinarySearchTree5() { BinaryTree treeLevel20 = new BinaryTree(-10); BinaryTree treeLevel21 = new BinaryTree(3); BinaryTree treeLevel22 = new BinaryTree(12); BinaryTree treeLevel10 = new BinaryTree(treeLevel20, null, 1); BinaryTree treeLevel11 = new BinaryTree(treeLevel21, treeLevel22, 5); BinaryTree treeLevel0 = new BinaryTree(treeLevel10, treeLevel11, 0); assertThat("This binary tree should not be BST", isBinarySearchTree(treeLevel0), is(false)); }