@Test public void testLock() throws Exception { HoldCountLock lock1 = new HoldCountLock(new ReentrantLock()); HoldCountLock lock2 = new HoldCountLock(new ReentrantLock()); CompositeLock compositeLock = new CompositeLock(lock1, lock2); compositeLock.lock(); assertEquals(1, lock1.holdCount().value); assertEquals(1, lock2.holdCount().value); }
@Override public void lock() { Locks.lockAll(locks); }
CompositeLock implements Lock { @Override public void lock() { Locks.lockAll(locks); } }
CompositeLock implements Lock { @Override public void lock() { Locks.lockAll(locks); } CompositeLock(Lock... locks);  CompositeLock(Deque<Lock> locks); }
CompositeLock implements Lock { @Override public void lock() { Locks.lockAll(locks); } 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 lock() { Locks.lockAll(locks); } 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();  }