@Test
  public void testSizeEnforcement() {
    BoundedList boundedList = getBoundedListForTest();
    for (int i = 15; i > 0; i--) {
      boundedList.add("v" + i);
    }
    Assert.assertEquals("List sizes should be as configured at creation time", boundedList.getValues().size(), 10);

    int valueIndex = 10;
    Collection<String> currentList = boundedList.getValues();
    Iterator iterator = currentList.iterator();
    while (iterator.hasNext()) {
      String gaugeValue = (String) iterator.next();
      Assert.assertTrue(gaugeValue.equals("v" + valueIndex));
      valueIndex--;
    }
  }
Class to encapsulate test-cases for {@link BoundedList}
samza-core/src/test/scala/org/apache/samza/metrics/TestBoundedList.java