ReadWriteSharedLock extends ReentrantReadWriteLock { public int getReadHoldCount() { return readers.getReadHoldCount(); }  int getReadHoldCount(); int getReadLockCount(); int getWriteHoldCount(); int getWriteLockCount(); boolean isWriteLockedByCurrentThread(); @Override ReadLock readLock(); @Override String toString(); @Override WriteLock writeLock();  }
@Test public void testGetReadHoldCount() { int count = TestData.getScaleCount(); for (int i = 0; i < count; i++) { lock.readLock().lock(); } Assert.assertEquals(lock.getReadHoldCount(), count); }