protected function getMostSpecificCandidate(
        array $candidates,
        string $sourceClassName,
        string $destinationClassName
    ): ?MappingInterface {
        $lowestDistance = PHP_INT_MAX;
        $selectedCandidate = null;
        /** @var MappingInterface $candidate */
        foreach($candidates as $candidate) {
            $sourceDistance = $this->getClassDistance(
                $sourceClassName,
                $candidate->getSourceClassName()
            );
            $destinationDistance = $this->getClassDistance(
                $destinationClassName,
                $candidate->getDestinationClassName()
            );
            $distance = $sourceDistance + $destinationDistance;

            if ($distance < $lowestDistance) {
                $lowestDistance = $distance;
                $selectedCandidate = $candidate;
            }
        }

        return $selectedCandidate;
    }