/**
  * Queries whether the given thread is waiting to acquire this lock. Note that because
  * cancellations may occur at any time, a <tt>true</tt> return does not guarantee that this thread
  * will ever acquire this lock. This method is designed primarily for use in monitoring of the
  * system state.
  *
  * @param thread the thread
  * @return true if the given thread is queued waiting for this lock.
  * @throws NullPointerException if thread is null
  */
 public final boolean hasQueuedThread(Thread thread) {
   return sync.isQueued(thread);
 }