title: Limited SortedSet
body: <p>i'm looking for an implementation of SortedSet with a limited number of elements. So if there are more elements added then the specified Maximum the comparator decides if to add the item and remove the last one from the Set.</p>
  
  <pre><code>SortedSet&lt;Integer&gt; t1 = new LimitedSet&lt;Integer&gt;(3);
  t1.add(5);
  t1.add(3);
  t1.add(1);
  // [1,3,5]
  t1.add(2);
  // [1,2,3]
  t1.add(9);
  // [1,2,3]
  t1.add(0);
  // [0,1,2]
  </code></pre>
  
  <p>Is there an elegant way in the standard API to accomplish this?</p>
  
  <p>I've wrote a JUnit Test for checking implementations:</p>
  
  <pre><code>@Test
  public void testLimitedSortedSet() {
  final LimitedSortedSet&lt;Integer&gt; t1 = new LimitedSortedSet&lt;Integer&gt;(3);
  t1.add(5);
  t1.add(3);
  t1.add(1);
  System.out.println(t1);
  // [1,3,5]
  t1.add(2);
  System.out.println(t1);
  // [1,2,3]
  t1.add(9);
  System.out.println(t1);
  // [1,2,3]
  t1.add(0);
  System.out.println(t1);
  // [0,1,2]
  Assert.assertTrue(3 == t1.size());
  Assert.assertEquals(Integer.valueOf(0), t1.first());
  }
  </code></pre>