LockManagerImpl implements LockManager { @Override public Iterable<ILock> getLocks() { return storage.read(storeProvider -> storeProvider.getLockStore().fetchLocks()); } @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 testGetLocks() throws Exception { control.replay(); ILock lock = lockManager.acquireLock(LOCK_KEY, USER); assertEquals(lock, Iterables.getOnlyElement(lockManager.getLocks())); }