int[] a = { 1, 4, 9 };int v = 7;int pos = Arrays.binarySearch(a, v); // Returns -3; v should be inserted before position 2