What is the problem in my code two test case failed

import java.util.*;
public class Main {
static int binarySearch(int[] arr,int data) {
int low = 0;
int high = arr.length - 1;

	while (low <= high) {
		int mid = (low + high) / 2;
	    if(data>arr[mid]) {
	    	low=mid+1;
	    }
	    else if(data<arr[mid]) {
	    	high=low-1;
	    }
	    else {
	    	return mid;
	    }
	}
	return -1;
}
public static void main(String args[]) {

Scanner sc = new Scanner(System.in);
int size = sc.nextInt();

	int[] arr = new int[size];

	for (int i = 0; i < arr.length; i++) {
		arr[i] = sc.nextInt();
	}
    int data = sc.nextInt();
	int result = binarySearch(arr,data);
	if (result > 0)
		System.out.println(result);
}

}

@nigamshubham1998,
If the element does not exist in the input array, then also print -1 as output.

Test case:
input:
5
1 2 3 4 5
6
expected Output:
-1
your output:
nothing is printed on the console.