code: public static void removeTimer(ScheduledTimer timer) {
      Preconditions.checkNotNull(timer, "timer");
      try (LockResource r = new LockResource(sLock)) {
        ScheduledTimer removedTimer = sTimers.remove(timer.getThreadName());
        Preconditions.checkNotNull(removedTimer, "sTimers should contain %s", timer.getThreadName());
        Preconditions.checkState(removedTimer == timer,
            "sTimers should contain the timer being removed");
      }
    }
docs: Removes a timer from the scheduler.
  
  This method will fail if the timer is not in the scheduler.
  
  @param timer the timer to remove