package simizer.laws;

import org.junit.*;

/**
 * Basic tests that should be run on all Law subclasses.
 */
@Ignore
public class LawTest {
  protected Law law;

  /**
   * Outputs values from the law to evaluate their distribution.
   */
  @Test
  public void testOutput() {
    for (int i = 0; i < 10000; i++) {
      System.out.println(law.nextValue());
    }
  }
}

@@ -16,16 +16,48 @@
 .laws;%0A%0A
+import java.lang.reflect.Field;%0A
 import o
@@ -391,11 +391,1379 @@
    %7D%0A  %7D
+%0A%0A  /**%0A   * Tests whether or not the theoretically maximum value can be achieved.%0A   *%0A   * @throws Exception if there is a problem with the reflection%0A   */%0A  @Test%0A  public void testMaximum() throws Exception %7B%0A    Field upperBound = Law.class.getDeclaredField(%22upperBound%22);%0A    upperBound.setAccessible(true);%0A    int bound = (Integer) upperBound.get(law);%0A%0A    long target = System.currentTimeMillis() + 4*1000;%0A%0A    boolean found = false;%0A    while (System.currentTimeMillis() %3C target) %7B%0A      int value = law.nextValue();%0A      Assert.assertTrue(%22generated a value that was too large%22, value %3C bound);%0A      Assert.assertTrue(%22generated a value that was too small%22, value %3E= 0);%0A%0A      if (value == (bound - 1)) %7B%0A        found = true;%0A        break;%0A      %7D%0A    %7D%0A    Assert.assertTrue(%22could not generate the maximum value%22, found);%0A  %7D%0A%0A  /**%0A   * Tests whether or not the theoretically minimum value can be achieved.%0A   */%0A  @Test%0A  public void testMinimum() %7B%0A    long target = System.currentTimeMillis() + 4*1000;%0A%0A    boolean found = false;%0A    while (System.currentTimeMillis() %3C target) %7B%0A      int value = law.nextValue();%0A      Assert.assertTrue(%22generated a value that was too small%22, value %3E= 0);%0A%0A      if (value == 0) %7B%0A        found = true;%0A        break;%0A      %7D%0A    %7D%0A    Assert.assertTrue(%22could not generate the minimum value%22, found);%0A  %7D
 %0A%7D%0A

Add unit tests to check the min/max range values.