@Test public void continuesRefreshingLocksThatAreReturned() { when(timelock.refreshLockLeases(TOKENS)).thenReturn(TOKENS); registerLocks(); tick(); tick(); verify(timelock, times(2)).refreshLockLeases(TOKENS); }
public void registerLocks(Collection<LockToken> tokens) { tokensToRefresh.addAll(tokens); }
LockRefresher implements AutoCloseable { public void registerLocks(Collection<LockToken> tokens) { tokensToRefresh.addAll(tokens); } }
LockRefresher implements AutoCloseable { public void registerLocks(Collection<LockToken> tokens) { tokensToRefresh.addAll(tokens); } LockRefresher(
            ScheduledExecutorService executor,
            TimelockService timelockService,
            long refreshIntervalMillis); }
LockRefresher implements AutoCloseable { public void registerLocks(Collection<LockToken> tokens) { tokensToRefresh.addAll(tokens); } LockRefresher(
            ScheduledExecutorService executor,
            TimelockService timelockService,
            long refreshIntervalMillis); void registerLocks(Collection<LockToken> tokens); void unregisterLocks(Collection<LockToken> tokens); @Override void close(); }
LockRefresher implements AutoCloseable { public void registerLocks(Collection<LockToken> tokens) { tokensToRefresh.addAll(tokens); } LockRefresher(
            ScheduledExecutorService executor,
            TimelockService timelockService,
            long refreshIntervalMillis); void registerLocks(Collection<LockToken> tokens); void unregisterLocks(Collection<LockToken> tokens); @Override void close();  }