private void evictBasedOnSize() {
    int numToEvict = this.elements.size() - this.maxNumberOfItems;
    while (numToEvict > 0) {
      this.elements.poll(); // remove head
      numToEvict--;
    }
  }
Evicts entries from elements in FIFO order until it has maxNumberOfItems
samza-core/src/main/scala/org/apache/samza/diagnostics/BoundedList.java