title: How to leftshift an ArrayList
body: <p>I'm using an ArrayList to hold a history of objects. Each new object I add using the .add method, like:</p>
  
  <pre><code>if(event.getAction() == MotionEvent.ACTION_UP)
  {
      if(currentWord != null)
      {
          wordHist.add(currentWord);
      }
  
      if(wordHist.size() &gt; WORDHIST_MAX_COUNT)
      {
          wordHist.remove(0);
      }
  }
  </code></pre>
  
  <p>However I don't want this to grow indefinitely, but to be limited to a certain value. If it reaches this maximum value, I want the oldest object (index 0) to be removed, and the rest to be left shifted, so previous index 1 is now index 0, etc.</p>
  
  <p>How can this be done?</p>
  
  <p>Thanks</p>