code: private static int binarySearch(int[] arr, int value) {
  		int found = 0;
  		int left = 0;
  		int right = arr.length - 1;
  		while (left < right) {
  			if (right - left == 1) {
  				found = value < arr[left] ? left : right;
  				break;
  			}
  
  			int middle = left + (right - left) / 2;
  			if (value < arr[middle]) {
  				right = middle;
  			} else {
  				left = middle;
  			}
  		}
  		return found;
  	}
docs: return index of smallest element that is greater than "value"