code: protected void cancelScheduledTasks() {
          assert inEventLoop();
          PriorityQueue<ScheduledFutureTask<?>> scheduledTaskQueue = this.scheduledTaskQueue;
          if (isNullOrEmpty(scheduledTaskQueue)) {
              return;
          }
  
          final ScheduledFutureTask<?>[] scheduledTasks =
                  scheduledTaskQueue.toArray(new ScheduledFutureTask<?>[0]);
  
          for (ScheduledFutureTask<?> task: scheduledTasks) {
              task.cancelWithoutRemove(false);
          }
  
          scheduledTaskQueue.clearIgnoringIndexes();
      }
docs: Cancel all scheduled tasks.
  
  This method MUST be called only when {@link #inEventLoop()} is {@code true}.