protected static function getMock(array &$injectedObjects, $countsArray, $className)
    {
        if (!isset($injectedObjects[$className]) || !$injectedObjects[$className])
        {
            return null;
        }

        if (!is_array($injectedObjects[$className]))
        {
            return $injectedObjects[$className];
        }

        $currentCount = isset(self::$usedMockCounts[$countsArray][$className]) ? self::$usedMockCounts[$countsArray][$className] : -1;
        ++ $currentCount;

        self::$usedMockCounts[$countsArray][$className] = $currentCount;
        return $injectedObjects[$className][$currentCount];
    }