source: class GmpTest {
  
    public static final ModPowStrategy JAVA;
    public static final ModPowStrategy INSECURE;
    public static final ModPowStrategy INSECURE_GMP_INTS;
    public static final ModPowStrategy SECURE;
    public static final ModPowStrategy SECURE_GMP_INTS;
     ModPowStrategy strategy;
  
    @Test public void testExactDivideSmallExhaustive() {
  
target:     for (int a = 10; a >= -10; --a) {
        for (int b = 10; b >= -10; --b) {
          int p = a * b;
          BigInteger aVal = BigInteger.valueOf(a);
          BigInteger bVal = BigInteger.valueOf(b);
          BigInteger pVal = BigInteger.valueOf(p);
  
          // exactDivide should work both ways
          if (a != 0) {
            assertEquals(String.format("a %d, b %d, p %d", a, b, p), bVal, exactDivide(pVal, aVal));
          } else {
            try {
              exactDivide(pVal, aVal);
              fail("ArithmeticException expected");
            } catch (ArithmeticException expected) {
            }
          }
        }
      }
    }
  
  }