class App {

  /**
   * The main method for the leader followers pattern.
   */
  public static void main(String[] args) throws InterruptedException {
    var taskSet = new TaskSet();
    var taskHandler = new TaskHandler();
    var workCenter = new WorkCenter();
    workCenter.createWorkers(4, taskSet, taskHandler);
    execute(workCenter, taskSet);
  }

  /**
   * Start the work, dispatch tasks and stop the thread pool at last.
   */
  private static void execute(WorkCenter workCenter, TaskSet taskSet) throws InterruptedException {<FILL_FUNCTION_BODY>}

  /**
   * Add tasks.
   */
  private static void addTasks(TaskSet taskSet) throws InterruptedException {
    var rand = new SecureRandom();
    for (var i = 0; i < 5; i++) {
      var time = Math.abs(rand.nextInt(1000));
      taskSet.addTask(new Task(time));
    }
  }
}

    var workers = workCenter.getWorkers();
    var exec = Executors.newFixedThreadPool(workers.size());
    workers.forEach(exec::submit);
    Thread.sleep(1000);
    addTasks(taskSet);
    exec.awaitTermination(2, TimeUnit.SECONDS);
    exec.shutdownNow();
  
<no_super_class>