public void testChronology() {
        int iterations = iIterations;
        long seed = iSeed;
        String modeStr;
        if (iMode == GREGORIAN_MODE) {
            modeStr = "Gregorian";
        } else {
            modeStr = "Julian";
        }

        System.out.println("\nTesting " + modeStr + " chronology over " + iterations + " iterations");

        Random rnd = new Random(seed);
        long updateMillis = System.currentTimeMillis() + UPDATE_INTERVAL;

        for (int i=0; i<iterations; i++) {
            long now = System.currentTimeMillis();
            if (now >= updateMillis) {
                updateMillis = now + UPDATE_INTERVAL;
                double complete = ((int)((double)i / iterations * 1000.0)) / 10d;
                if (complete < 100) {
                    System.out.println("" + complete + "% complete (i=" + i + ")");
                }
            }

            long millis = randomMillis(rnd);
            int value = rnd.nextInt(200) - 100;
            // millis2 is used for difference tests.
            long millis2 = millis + rnd.nextLong() % _1000_YEARS - _500_YEARS;

            try {
                testFields(millis, value, millis2);
            } catch (RuntimeException e) {
                System.out.println("Failure index: " + i);
                System.out.println("Test millis: " + millis);
                System.out.println("Test value: " + value);
                System.out.println("Test millis2: " + millis2);
                fail(e.getMessage());
            }
        }

        System.out.println("100% complete (i=" + iterations + ")");
    }