question: public synchronized void add ( T newElement ) { if ( elements . size ( ) - 1 > nextElementIndex ) { elements . set ( nextElementIndex ++ , newElement ) ; } else { elements . add ( nextElementIndex ++ , newElement ) ; } if ( nextElementIndex == capacity ) { nextElementIndex = 0 ; } }
target:  Add an element to the buffer.