### Question:
BinarySearch { public static boolean find(int[] datas, int dataToFind) { int leftIndex = 0, rightIndex = datas.length - 1, index = datas.length / 2; while(rightIndex - leftIndex >= 0) { if (leftIndex == rightIndex) { return dataToFind == datas[index]; } if (dataToFind == datas[index]) { return true; } if (dataToFind < datas[index]) { rightIndex = index - 1; } else { leftIndex = index + 1; } index = (leftIndex + rightIndex + 1) / 2; } return false; }  static boolean find(int[] datas, int dataToFind);  }### Answer:
@Test public void find() throws Exception { int[] datas = setIntSortedArrays(1000); assertTrue(BinarySearch.find(datas, 60)); assertTrue(BinarySearch.find(datas, 0)); assertFalse(BinarySearch.find(datas, 1001)); }
@Test public void find_Complicated_Case() throws Exception { int[] datas = { 1, 3, 5, 8, 9, 10 }; assertTrue(BinarySearch.find(datas, 5)); assertFalse(BinarySearch.find(datas, 7)); assertFalse(BinarySearch.find(datas, 90)); }