There should be a test case where some nodes have values equal to Integer.MIN_VALUE and Integer.MAX_VALUE;

This solution is accepted and shouldn't be:

```
public boolean isValidBST(TreeNode root) {
if (root == null) return true;
return isValidBST(root.left,Integer.MIN_VALUE, root.val)
&& isValidBST(root.right,root.val,Integer.MAX_VALUE);
}
public boolean isValidBST(TreeNode root, int smallest, int largest) {
if (root == null) return true;
if (root.val > smallest && root.val < largest)
return isValidBST(root.left,smallest, root.val)
&& isValidBST(root.right,root.val,largest);
else
return false;
}
```