title: Why not IndexOutOfBoundsException on List.subList(size, size)?
body: <p>I was looking at the List.subList() method. I wondered why the following code doesn't throw an IndexOutOfBoundsException.</p>
  
  <pre><code>ArrayList&lt;String&gt; someList = new ArrayList&lt;&gt;();
  someList.add("A");
  someList.add("B");
  someList.add("C");
  someList.add("D");
  someList.add("E");
  
  someList.subList(5, 5);
  </code></pre>
  
  <p>The docs says subList is subList(fromIndex, toIndex), where fromIndex is inclusive. Since my list.size() is 5, the indexes goes from 0 to 4. So if fromIndex is inclusive, shouldn't an Exception be thrown?</p>
  
  <p>From the docs:</p>
  
  <pre><code>fromIndex - low endpoint (inclusive) of the subList
  toIndex - high endpoint (exclusive) of the subList
  
  IndexOutOfBoundsException - for an illegal endpoint index value (fromIndex &lt; 0 || toIndex &gt; size || fromIndex &gt; toIndex)
  </code></pre>
  
  <p>I understand the boolean expression here. But shouldn't it be (... || fromIndex >= toIndex)?</p>
  
  <p>What am I missing?</p>