title: How can I slice an ArrayList out of an ArrayList in Java?
body: <p>How do I get an array slice of an <code>ArrayList</code> in Java? Specifically I want to do something like this: </p>
  
  <pre><code>ArrayList&lt;Integer&gt; inputA = input.subList(0, input.size()/2);
  // where 'input' is a prepouplated ArrayList&lt;Integer&gt;
  </code></pre>
  
  <p>So I expected this to work, but Java returns a <code>List</code> - so it's incompatible. And when I try to cast it, Java won't let me. I need an <code>ArrayList</code> - what can I do?</p>