Please find the code below for a simple Binary Search Tree check:
Java Code:

class Tree {
	
	int value;
	Tree left;
	Tree  right;
	
	public Tree (int a){
		
		value = a;
		left = right = null;
		}
	
}



public class VerifyBST {

	
	
public static boolean ifBST(Tree myTree, int small , int large){
		
		if(myTree == null)
			return true;
		if(myTree.value > small && myTree.value < large){
			
		boolean leftBST = ifBST(myTree.left, small,myTree.value);
		boolean rightBST = ifBST(myTree.right,myTree.value,large);
			
		return leftBST&&rightBST;
		}
		else{
		
		return false;
		}
		
	}
	
	public static void main(String[] args) {
		/*
		
		        4
               / \
              2	  6	      
		     / \  /\
	        1	3 5 7         */
		
		Tree myTree = new Tree(4);
		
		myTree.left = new Tree(2);
		myTree.right = new Tree(6);
		
		myTree.left.left = new Tree(1);
		myTree.left.right = new Tree(3);
		
		myTree.right.left = new Tree(5);
		myTree.right.right = new Tree(7);
		
		
		
		System.out.println("BST or NOT?" + ifBST(myTree,Integer.MIN_VALUE,Integer.MAX_VALUE));
		
		
		

	}

}
My Questions:

1) As clear from the code, I have manually entered all the entries of my binary tree, so if there is a
case where I need to check for large tree where manual entried won't be a good idea, what should be the
best approach one should follow then?

2) Since I have passed ifBST(myTree,Integer.MIN_VALUE,Integer.MAX_VALUE) in the main method,
does this mean that Integer.MIN_VALUE = 1 and Integer.MAX_VALUE = 7 is passed to the method body?

3) Could you explain how the comparisons are made, the code is bit confusing for me.

Thanks