@Override
    public boolean probablyPrime(BigInteger number, int repeats, boolean enhancedVerbosity) {
        if( number.equals(new BigInteger("2") ))
            return true;

        for (int i = 0; i < repeats; ++i) {
            if (logger != null && enhancedVerbosity) {
                logger.setStepName(String.format("Solovay-Strassen (%d):", i));
                logger.log(String.format("Round %d started...", i));
            }

            BigInteger base = randomNumberService.generateRandomNumberFromRange(number);

            JacobiSymbol jacobiSymbol = new JacobiSymbol(base, number, logger);
            int right = jacobiSymbol.resolve(enhancedVerbosity);
            BigInteger left = base.modPow(number.subtract(BigInteger.ONE).divide(new BigInteger("2")), number);
            BigInteger bigRight = number.add(new BigInteger(Integer.toString(right))).mod(number);

            if (!left.equals(bigRight)) {
                if (logger != null) {
                    logger.log(String.format("Found a complexity proof by number: %s", base.toString()));
                }
                return false;
            }
        }
        if (logger != null) {
            logger.log(String.format("Test completed, number is probably prime."));
        }
        return true;
    }