code: @Override
      public boolean offer(E e) {
          Objects.requireNonNull(e);
  
          boolean notEmpty = false;
          _tailLock.lock(); // Size cannot grow... only shrink
          try {
              int size = _size.get();
              if (size >= _maxCapacity)
                  return false;
  
              // Should we expand array?
              if (size == _elements.length) {
                  _headLock.lock();
                  try {
                      if (!grow())
                          return false;
                  } finally {
                      _headLock.unlock();
                  }
              }
  
              // Re-read head and tail after a possible grow
              int tail = _indexes[TAIL_OFFSET];
              _elements[tail] = e;
              _indexes[TAIL_OFFSET] = (tail + 1) % _elements.length;
              notEmpty = _size.getAndIncrement() == 0;
          } finally {
              _tailLock.unlock();
          }
  
          if (notEmpty) {
              _headLock.lock();
              try {
                  _notEmpty.signal();
              } finally {
                  _headLock.unlock();
              }
          }
  
          return true;
      }
docs: /*----------------------------------------------------------------------------