public void TestHasWaitersTSE()
 {
     ReentrantReadWriteLock locker = new ReentrantReadWriteLock();
     Condition c = (locker.WriteLock.NewCondition());
     try
     {
         locker.HasWaiters(c);
         ShouldThrow();
     }
     catch (ThreadStateException)
     {
     }
     catch (Exception e)
     {
         UnexpectedException(e);
     }
 }
     public void TestGetWaitQueueLength()
     {
         ReentrantReadWriteLock locker = new ReentrantReadWriteLock();
         Condition c = (locker.WriteLock.NewCondition());
         Pair data = new Pair(locker, c);
         Thread t = new Thread(TestGetWaitQueueLengthRun);
 
         try
         {
             t.Start(data);
             Thread.Sleep(SHORT_DELAY_MS);
             locker.WriteLock.Lock();
             Assert.IsTrue(locker.HasWaiters(c));
             Assert.AreEqual(1, locker.GetWaitQueueLength(c));
             c.Signal();
             locker.WriteLock.UnLock();
             Thread.Sleep(SHORT_DELAY_MS);
             locker.WriteLock.Lock();
             Assert.IsFalse(locker.HasWaiters(c));
             Assert.AreEqual(0, locker.GetWaitQueueLength(c));
             locker.WriteLock.UnLock();
             t.Join(SHORT_DELAY_MS);
             Assert.IsFalse(t.IsAlive);
         }
         catch (Exception e)
         {
             UnexpectedException(e);
         }
     }
 public void TestHasWaitersNRE()
 {
     ReentrantReadWriteLock locker = new ReentrantReadWriteLock();
     try
     {
         locker.HasWaiters(null);
         ShouldThrow();
     }
     catch (NullReferenceException)
     {
     }
     catch (Exception e)
     {
         UnexpectedException(e);
     }
 }