@Test public void testReadLockHoldCount() throws Exception { reentrantReadWriteUpdateLock.readLock().lock(); int hc1 = ((ReentrantReadWriteUpdateLock.ReadLock)reentrantReadWriteUpdateLock.readLock()).holdCount().value; reentrantReadWriteUpdateLock.readLock().unlock(); int hc2 = ((ReentrantReadWriteUpdateLock.ReadLock)reentrantReadWriteUpdateLock.readLock()).holdCount().value; assertEquals(1, hc1); assertEquals(0, hc2); }
@Override public Lock readLock() { return readLock; }
ReentrantReadWriteUpdateLock implements ReadWriteUpdateLock { @Override public Lock readLock() { return readLock; } }
ReentrantReadWriteUpdateLock implements ReadWriteUpdateLock { @Override public Lock readLock() { return readLock; }  }
ReentrantReadWriteUpdateLock implements ReadWriteUpdateLock { @Override public Lock readLock() { return readLock; }  @Override Lock updateLock(); @Override Lock readLock(); @Override Lock writeLock(); }
ReentrantReadWriteUpdateLock implements ReadWriteUpdateLock { @Override public Lock readLock() { return readLock; }  @Override Lock updateLock(); @Override Lock readLock(); @Override Lock writeLock();  }