question: public T add ( T e ) { T oldE = null ; while ( ! buffer . offerLast ( e ) ) { oldE = buffer . poll ( ) ; } return oldE ; }
target:  Adding an element to the circular buffer implies adding the element to the tail of the deque. In doing so, if the capacity of the buffer has been exhausted, then the deque's head should be removed to preserve the circular nature of the buffer. A LinkedBlockingDeque is used because of its concurrent nature and the fact that adding to tail and removing from head are both O(1) operations. The removed head is returned to the caller for reuse.