### Question:
AutoLock implements AutoCloseable, Lock { public AutoLock() { this(new ReentrantLock()); } AutoLock();  AutoLock(Lock lock); AutoLock autoLock(); @Override void close(); @Override void lock(); @Override void lockInterruptibly(); @Override boolean tryLock(); @Override boolean tryLock(long time, TimeUnit unit); @Override void unlock(); @Override Condition newCondition(); @Override String toString();  }### Answer:
@Test public void testAutoClose() { ReentrantLock lock = new ReentrantLock(); assertFalse(lock.isHeldByCurrentThread()); AutoLock al = new AutoLock(lock); try (AutoLock al2 = al.autoLock()) { assertTrue(lock.isHeldByCurrentThread()); } assertFalse(lock.isHeldByCurrentThread()); }