code: public Reference<? extends T> remove(long timeout)
          throws IllegalArgumentException, InterruptedException
      {
          if (timeout < 0) {
              throw new IllegalArgumentException("Negative timeout value");
          }
          synchronized (lock) {
              Reference<? extends T> r = reallyPollLocked();
              if (r != null) return r;
              long start = (timeout == 0) ? 0 : System.nanoTime();
              for (;;) {
                  lock.wait(timeout);
                  r = reallyPollLocked();
                  if (r != null) return r;
                  if (timeout != 0) {
                      long end = System.nanoTime();
                      timeout -= (end - start) / 1000_000;
                      if (timeout <= 0) return null;
                      start = end;
                  }
              }
          }
      }
docs: Removes the next reference object in this queue, blocking until either
  one becomes available or the given timeout period expires.
  
  <p> This method does not offer real-time guarantees: It schedules the
  timeout as if by invoking the {@link Object#wait(long)} method.
  
  @param  timeout  If positive, block for up to <code>timeout</code>
  milliseconds while waiting for a reference to be
  added to this queue.  If zero, block indefinitely.
  
  @return  A reference object, if one was available within the specified
  timeout period, otherwise <code>null</code>
  
  @throws  IllegalArgumentException
  If the value of the timeout argument is negative
  
  @throws  InterruptedException
  If the timeout wait is interrupted