title: Collections.binarySearch(List list, K key) clarification. Java
body: <p>Given the following statement, taken from <a href="http://docs.oracle.com/javase/tutorial/collections/algorithms/index.html#shuffling" rel="noreferrer">this</a> Oracle java tutorial, related to the binarySearch() method of the class Collections:</p>
  
  <blockquote>
    <p>The return value is the same for both forms. If the List contains the
    search key, its index is returned. If not, the return value is
    <strong>(-(insertion point) - 1)</strong>, where the insertion point is the point at
    which the value would be inserted into the List, or the index of the
    first element greater than the value or list.size() if all elements in
    the List are less than the specified value.</p>
  </blockquote>
  
  <p>Why does the return value of <code>binarySearch()</code> not return only the negative index instead of the negative index minus 1? (the part in bold of the quote above mentioned).</p>
  
  <p>In brief: why <code>(-(insertion point) - 1)</code> and not only <code>(-(insertion point))</code>? </p>
  
  <p>Thanks in advance.</p>