default long preHeat(List<TestCase> testCases, long preheatIterations, boolean log) {
        if (testCases == null || testCases.isEmpty()) {
            LOG.fatal("NO PREHEAT WAS DONE. This should never occur.");
            return 0;
        }
        if (preheatIterations <= 0) {
            LOG.warn("NO PREHEAT WAS DONE. Simply because you asked for %d to run.", preheatIterations);
            return 0;
        }
        if (preheatIterations > MAX_PRE_HEAT_ITERATIONS) {
            LOG.warn("NO PREHEAT WAS DONE. Simply because you asked for too many (%d > %d) to run.", preheatIterations, MAX_PRE_HEAT_ITERATIONS);
            return 0;
        }
        if (log) {
            LOG.info("Preheating JVM by running %d testcases.", preheatIterations);
        }
        long remainingIterations = preheatIterations;
        long syntaxErrors = 0;
        long startTime = System.nanoTime();
        while (remainingIterations > 0) {
            for (TestCase testCase : testCases) {
                remainingIterations--;
                // Calculate and use result to guarantee not optimized away.
                if(parse(testCase.getHeaders()).hasSyntaxError()) {
                    syntaxErrors++;
                }
                if (remainingIterations <= 0) {
                    break;
                }
            }
        }
        long stopTime = System.nanoTime();

        if (log) {
            LOG.info("Preheating JVM completed. Parsing %d testcases took %d ms (average %6.6f ms)",
                preheatIterations, (stopTime-startTime)/1_000_000, (stopTime-startTime)/1_000_000.0/preheatIterations);
            // We only have this next line to avoid the optimizer not running the parsing
            LOG.trace("Of those %d had a Syntax Error", syntaxErrors);
        }
        return preheatIterations;
    }
Runs the number of specified testcases to heat up the JVM.
@param preheatIterations Number of desired tests to run.
@param log Enable logging?
@return Number of actually done testcases.
analyzer/src/main/java/nl/basjes/parse/useragent/AnalyzerPreHeater.java