length === 0) return clusters;

    const firstTask = sortedLongTasks[0];
    const restOfTasks = sortedLongTasks.slice(1);

    let currentClusterTasks = [firstTask];

    for (const currTask of restOfTasks) {
      const prevTask = currentClusterTasks[currentClusterTasks.length - 1];
      if (currTask.start - prevTask.end < FCI_MIN_CLUSTER_SEPARATION_MS) {
        // Add task to current task cluster.
        currentClusterTasks.push(currTask);
      } else {
        // Wrap up the current cluster and add