title: How to split array list into equal parts?
body: <p>Is there anyway to split ArrayList into different parts without knowing size of it until runtime? I know there is a method called:</p>
  
  <pre><code>list.subList(a,b);
  </code></pre>
  
  <p>but we need to explicitly mention staring and ending range of list.
  My problem is, we get a arraylist containing account numbers which is having data like 2000,4000 account numbers (there numbers will not be known during coding time), and I need to pass this acc nos into IN query of PL/SQL, as IN doesn't support more than 1000 values in it, I am trying to split into multiple chunks and sending it to query</p>
  
  <p>Note: I cannot use any external libraries like Guava etc.. :(
  Any guide in this regard is appreciated.</p>