@Test public void doesNotFailIfDelegateThrows() { ImmutableSet<LockToken> lockTokensToRefresh = ImmutableSet.of(TOKEN_1); when(timelock.refreshLockLeases(any())) .thenThrow(new RuntimeException("test")) .thenReturn(lockTokensToRefresh); refresher.registerLocks(lockTokensToRefresh); tick(); tick(); verify(timelock, times(2)).refreshLockLeases(lockTokensToRefresh); }
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();  }