public void check_random(RandomNumberGenerator generator, int seed) 
  {
    // set the seed of the random number generator
    generator.set_seed(seed);

    clear_histogram();

    // test odd/even of numbers
    // test average number
    for (int i = 0; i < this.max_size; i++) {
      int value = generator.next_int(this.max_size);

      this.histogram_[value]++;

      this.average_of_all_ += value;
      this.counter_++;

      if (this.previous_ >= 0) 
	  {
        if (is_odd(this.previous_)) 
		{
          if (is_odd(value)) 
		  {
            this.odd_odd_count_++;
          } 
		  else 
		  {
            this.odd_even_count_++;
          }
        } 
		else 
		{
          if (is_odd(value)) 
		  {
            this.even_odd_count_++;
          } 
		  else 
		  {
            this.even_even_count_++;
          }
        }
      }

      this.previous_ = value;
    }

    Arrays.sort(this.histogram_);

    // max_size iterations tested. now see how many zeros
    while (this.histogram_[this.number_of_zeros_after_ten_thousand] == 0) 
	{
      this.number_of_zeros_after_ten_thousand++;
    }

    fill_array(generator); // determine how many calls to next_int are required
    // to hit every number

    // time how long it takes to generate 10,000,000 numbers
    long start_time = System.nanoTime();
    for (int i = 0; i < 10000000; i++) 
	{
      generator.next_int(10000);
    }
    long end_time = System.nanoTime();

    // finally print some stats:
    System.out.println("\n  -- Random Number Tester Stats --\n");

    System.out.printf(
        "Time to generate 10000000 random numbers is:  %.1f seconds\n\n",
        (float) ((end_time - start_time) / 1000000000.0));

    System.out.println("Number of Zeros after " + this.max_size + " tries: "
        + this.number_of_zeros_after_ten_thousand);
    System.out.println("Number of odd_even  pairs: " + this.odd_even_count_);
    System.out.println("Number of odd_odd   pairs: " + this.odd_odd_count_);
    System.out.println("Number of even_odd  pairs: " + this.even_odd_count_);
    System.out.println("Number of even_even pairs: " + this.even_even_count_
        + "\n");

    System.out.println("Average number is: " + (float) this.average_of_all_
        / (float) this.counter_);
    System.out.println("Median number of times a number was generated: "
        + this.histogram_[this.histogram_.length / 2]);
    System.out.println("Min    number of times a number was generated: "
        + this.histogram_[0]);
    System.out.println("Max    number of times a number was generated: "
        + this.histogram_[this.histogram_.length - 1] + "\n");

    System.out.println("Repeatability on Same Seed: " + test_seed(generator)
        + "\n");

    if (this.numbers_filled < this.max_size) 
	{
      System.out.println("Could not fill histogram after " + 1000000
          + " tries.");
      System.out.println("There were still "
          + (this.max_size - this.numbers_filled) + " indices empty\n");
    } 
	else 
	{
      System.out.println("It took " + this.numbers_generated
          + " generated numbers to hit every possibility from 0 to "
          + this.max_size);
    }
  } // end check_random