protected function resolveCallbacksForRoots(array $roots)
    {
        foreach ($roots as $i => $root) {
            $roots[$i] = $this->resolveCallbacksForRoot($root);
        }

        return $roots;
    }