private function mergeNeighborProgresses(array $progresses): array
    {
        $progressesCount = \count($progresses);

        if ($progressesCount === 0) {
            return [];
        }

        $merged = [];
        $last = $progresses[0];

        for ($step = 1; $step < $progressesCount; ++$step) {
            $progress = $progresses[$step];

            if ($last[0] === $progress[0]) {
                $progress[3] += $last[3];
            } else {
                $merged[] = $last;
            }

            $last = $progress;
        }

        $merged[] = $last;

        return $merged;
    }