private function getUrlAliasesForSwappedLocations(
        Language $language,
        SwappedLocationProperties $location1,
        SwappedLocationProperties $location2
    ) {
        $isMainLanguage1 = $language->id == $location1->mainLanguageId;
        $isMainLanguage2 = $language->id == $location2->mainLanguageId;
        $urlAliases = [];
        if (isset($location1->name)) {
            $urlAliases[] = new UrlAliasForSwappedLocation(
                $location1->id,
                $location1->parentId,
                $location1->name,
                $isMainLanguage2 && $location1->isAlwaysAvailable,
                $isMainLanguage2,
                $location1->autogeneratedId
            );
        }

        if (isset($location2->name)) {
            $urlAliases[] = new UrlAliasForSwappedLocation(
                $location2->id,
                $location2->parentId,
                $location2->name,
                $isMainLanguage1 && $location2->isAlwaysAvailable,
                $isMainLanguage1,
                $location2->autogeneratedId
            );

            if (isset($location1->name) && $this->shouldUrlAliasForSecondLocationBePublishedFirst(
                    $location1->entries,
                    $location1->parentId,
                    $location1->name,
                    $location2->entries,
                    $location2->parentId,
                    $location2->name,
                    $language->id
                )) {
                $urlAliases = array_reverse($urlAliases);
            }
        }

        return $urlAliases;
    }