public static void main(String[] args) {
Long[] operaregister = new Long[]{Long.valueOf(3), Long.valueOf(35)};
// <3 -1
System.out.println("2:"+Arrays.binarySearch(operaregister, Long.valueOf(2)));
// =3 0
System.out.println("3:"+Arrays.binarySearch(operaregister, Long.valueOf(3)));
// 3-35 -2
System.out.println("30:"+Arrays.binarySearch(operaregister, Long.valueOf(30)));
//35 1
System.out.println("3:"+Arrays.binarySearch(operaregister, Long.valueOf(35)));
//>35 -3
System.out.println("40:"+Arrays.binarySearch(operaregister, Long.valueOf(40)));
}