LockManagerImpl implements LockManager { @Override public void releaseLock(final ILock lock) { storage.write( (NoResult.Quiet) storeProvider -> storeProvider.getLockStore().removeLock(lock.getKey())); } @Inject  LockManagerImpl(Storage storage, Clock clock, UUIDGenerator tokenGenerator); @Override ILock acquireLock(final ILockKey lockKey, final String user); @Override void releaseLock(final ILock lock); @Override void assertNotLocked(final ILockKey context); @Override Iterable<ILock> getLocks();  }
@Test public void testReleaseLock() throws Exception { control.replay(); ILock lock = lockManager.acquireLock(LOCK_KEY, USER); lockManager.releaseLock(lock); lockManager.acquireLock(LOCK_KEY, USER); }