code: private E dequeue() {
          int n = size - 1;
          if (n < 0)
              return null;
          else {
              Object[] array = queue;
              E result = (E) array[0];
              E x = (E) array[n];
              array[n] = null;
              Comparator<? super E> cmp = comparator;
              if (cmp == null)
                  siftDownComparable(0, x, array, n);
              else
                  siftDownUsingComparator(0, x, array, n, cmp);
              size = n;
              return result;
          }
      }
docs: Mechanics for poll().  Call only while holding lock.