title: limited size Collection in java
body: <p>Which collection type in java should I use if I want to have something like <a href="https://stackoverflow.com/questions/5498865/size-limited-queue-that-holds-last-n-elements-in-java">Size-limited queue that holds last N elements in Java</a>.</p>
  
  <p>I have a list and I want to limit the size of the list to "100". So if i add the 101 th element in the list, the first element should be deleted automatically (FIFO). For example:</p>
  
  <pre><code>List&lt;Item&gt; items = ??;
  items.add(item_1);
  ...
  items.add(item_101); // implicitly calls items.remove(0);
  items.add(item_102); // implicitly calls items.remove(0);
  </code></pre>