private function getMatchingIndex(array $matchingList, PreferenceInterface $pref)
    {
        $index = -1;

        foreach ($matchingList as $key => $match) {
            if ($match->getVariant() === $pref->getVariant()) {
                $index = $key;
            }
        }

        return $index;
    }