Validate Binary Search Tree in Java