docs: private void swapAndCancelTask(AtomicReference<TimerTask> taskRef,
                                   TimerTask newTask) {
      TimerTask oldTask = taskRef.getAndSet(newTask);
      if (oldTask != null) {
        oldTask.cancel();
      }
    }