@Test public void testUnlock() throws Exception { HoldCountLock lock1 = new HoldCountLock(new ReentrantLock()); HoldCountLock lock2 = new HoldCountLock(new ReentrantLock()); CompositeLock compositeLock = new CompositeLock(lock1, lock2); compositeLock.lock(); compositeLock.unlock(); assertEquals(0, lock1.holdCount().value); assertEquals(0, lock2.holdCount().value); }
@Override public void unlock() { Locks.unlockAll(new Iterable<Lock>() { @Override public Iterator<Lock> iterator() { return locks.descendingIterator(); } }); }
CompositeLock implements Lock { @Override public void unlock() { Locks.unlockAll(new Iterable<Lock>() { @Override public Iterator<Lock> iterator() { return locks.descendingIterator(); } }); } }
CompositeLock implements Lock { @Override public void unlock() { Locks.unlockAll(new Iterable<Lock>() { @Override public Iterator<Lock> iterator() { return locks.descendingIterator(); } }); } CompositeLock(Lock... locks);  CompositeLock(Deque<Lock> locks); }
CompositeLock implements Lock { @Override public void unlock() { Locks.unlockAll(new Iterable<Lock>() { @Override public Iterator<Lock> iterator() { return locks.descendingIterator(); } }); } CompositeLock(Lock... locks);  CompositeLock(Deque<Lock> locks); @Override void lock(); @Override void lockInterruptibly(); @Override boolean tryLock(); @Override boolean tryLock(long time, TimeUnit unit); @Override void unlock(); @Override Condition newCondition(); }
CompositeLock implements Lock { @Override public void unlock() { Locks.unlockAll(new Iterable<Lock>() { @Override public Iterator<Lock> iterator() { return locks.descendingIterator(); } }); } CompositeLock(Lock... locks);  CompositeLock(Deque<Lock> locks); @Override void lock(); @Override void lockInterruptibly(); @Override boolean tryLock(); @Override boolean tryLock(long time, TimeUnit unit); @Override void unlock(); @Override Condition newCondition();  }