code: public void add(long value) {
          writeLock.lock();
          try {
              // do we need to evict anything?
              if (this.values.size() >= this.size) {
                  Long oldValue = this.values.pollFirst();
                  // subtract from running total
                  this.total -= oldValue.longValue();
              }
              // add this new value onto the end
              this.values.add(value);
              // add to our total
              this.total += value;
          } finally {
              writeLock.unlock();
          }
      }
docs: Adds a new value to our running total. If the running total has already
  reached its max size, this method will evict the oldest value.
  <br>
  NOTE: This method will use a writeLock to ensure thread-safety.
  @param value The new long value to add