private boolean checkRecursiveInner(BinaryNode<Integer> root) {
    if (root == null) {
      return true;
    } else {
      return (root.getLeft() == null || root.getData() >= root.getLeft().getData())
          && (root.getRight() == null || root.getData() <= root.getRight().getData())
          && checkRecursiveInner(root.getLeft())
          && checkRecursiveInner(root.getRight());
    }
  }
Recursive implementation to solve this problem. This algorithm has O(N) as complexity order in
time terms and O(1) in space terms.
src/main/java/com/github/pedrovgs/problem18/IsBST.java