protected function eliminateCandidates(array $candidates): int
    {
        $minimumCandidates = $this->getLowestCandidates($candidates);
        $count = count($minimumCandidates);

        // p. 52(2)(b) - the returning officer shall decide, by lot, which of those
        // candidates is to be excluded.
        // We do not look back on previous rounds at all as per p. 52(2)(a)
        $minimumCandidate = $minimumCandidates[(array_rand($minimumCandidates))];

        $this->logger->notice(sprintf('There were %d joint lowest candidates,
            %d was randomly selected to be eliminated', $count, $minimumCandidate->getId()));

        $this->transferEliminatedVotes($minimumCandidate);
        $minimumCandidate->setState(Candidate::DEFEATED);

        return count($minimumCandidates);
    }