RingBuffer
A ring buffer implementation that allows for a fixed-size buffer to be used as a sliding window. The buffer is circular and will overwrite the oldest elements when full.
Parameters
capacity
The maximum number of elements that the buffer can hold.