AutoLock extends ReentrantLock implements Holdable { @Override public Mutex hold() { lock(); return mutex; } AutoLock();  AutoLock(boolean fair); @Override Mutex hold(); @Override Mutex holdInterruptibly();  }
@Test void hold() { lock.hold(); verify(lock).lock(); }
@Test void close() { try (var mutex = lock.hold()) {} assertEquals(0, lock.getHoldCount()); }