What is wrong in my code?

import java.util.*;
class BST {

private class Node{
	int data;
	Node left;
	Node right;
}
private Node root;

public BST(int [] arr){
	root=construct(arr,0,arr.length-1);
	
}

private Node construct(int[] arr, int lo, int hi) {
	if (lo>hi) {
		return null;
	}
	int mid=(lo+hi)/2;
	
	//new node
	Node nn=new Node();
	nn.data=arr[mid];
	
	nn.left=construct(arr, lo, mid-1);
	nn.right=construct(arr, mid+1, hi);
	
	return nn;
}
public void preorder() {
	preorder(root);
}

private void preorder(Node node) {
	if (node==null) {
		return;
	}
	
	System.out.print(node.data+" ");
	
	
	
	preorder(node.left);
	
	
	preorder(node.right);
	
}

}
public class Main {
public static void main(String[] args) {
Scanner scn=new Scanner(System.in);
int t=scn.nextInt();
for(int i=0;i<t;i++) {
int n=scn.nextInt();
int [] arr=new int[n];
for (int j=0;j<n;j++) {
arr[j]=scn.nextInt();
}
BST bst=new BST(arr);
bst.preorder();

	}
	

}

}

Add new line each and every test
correct code