### Question:
AutoReadWriteLock implements ReadWriteLock { @Override public AutoLock readLock() { return readLock; } AutoReadWriteLock();  AutoReadWriteLock(ReadWriteLock lock); @Override AutoLock readLock(); @Override AutoLock writeLock(); AutoLock autoReadLock(); AutoLock autoWriteLock(); @Override String toString();  }### Answer:
@Test public void testReadLock() { ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); AutoReadWriteLock al = new AutoReadWriteLock(lock); assertEquals(0, lock.getReadLockCount()); try (AutoLock al2 = al.autoReadLock()) { assertEquals(1, lock.getReadLockCount()); } assertEquals(0, lock.getReadLockCount()); }