protected function fillKeys(Queue $queue, $lo, $hi, ?RedBlackNode $node): void
    {
        if ($node === null) {
            return;
        }

        $complo = $this->comparator->compare($lo, $node->key());
        $comphi = $this->comparator->compare($hi, $node->key());

        if ($complo < 0) {
            $this->fillKeys($queue, $lo, $hi, $node->left());
        }
        if ($complo <= 0 && $comphi >= 0) {
            $queue->enqueue($node->key());
        }
        if ($comphi > 0) {
            $this->fillKeys($queue, $lo, $hi, $node->right());
        }
    }