protected function getCountryCodeForValidRegion($regionCode)
    {
        $metadata = $this->getMetadataForRegion($regionCode);
        if ($metadata === null) {
            throw new \InvalidArgumentException('Invalid region code: ' . $regionCode);
        }
        return $metadata->getCountryCode();
    }