title: Fastest way of checking the condition l+1<r for int l,r in Java
body: <p>What is the fastest way of checking the condition</p>
  
  <pre><code>l + 1 &lt; r
  </code></pre>
  
  <p>for <code>int l,r</code> in Java?</p>
  
  <p><code>l</code> and <code>r</code> are not constant and I know that <code>l &lt;= r</code>. The comparison is a stopping condition for a <code>while</code> loop in a binary search implementation. I am of course benchmarking my code, both in a separate test (searching a large array) and in the code which uses it.</p>
  
  <p>What I am looking for, I imagine, is some sort of a bit operation which would be faster than the present condition. But I don't know.</p>