protected function buildDomainObjectStateObject(
        SPIObjectState $spiObjectState,
        APIObjectStateGroup $objectStateGroup = null,
        array $prioritizedLanguages = []
    ) {
        $objectStateGroup = $objectStateGroup ?: $this->loadObjectStateGroup($spiObjectState->groupId);

        return new ObjectState(
            [
                'id' => $spiObjectState->id,
                'identifier' => $spiObjectState->identifier,
                'priority' => $spiObjectState->priority,
                'mainLanguageCode' => $spiObjectState->defaultLanguage,
                'languageCodes' => $spiObjectState->languageCodes,
                'names' => $spiObjectState->name,
                'descriptions' => $spiObjectState->description,
                'objectStateGroup' => $objectStateGroup,
                'prioritizedLanguages' => $prioritizedLanguages,
            ]
        );
    }