@Test
public void testExactDivide() {

  assertEquals(BigInteger.valueOf(1), exactDivide(BigInteger.valueOf(1), BigInteger.valueOf(1)));
  assertEquals(BigInteger.valueOf(3), exactDivide(BigInteger.valueOf(9), BigInteger.valueOf(3)));
  assertEquals(BigInteger.valueOf(4), exactDivide(BigInteger.valueOf(12), BigInteger.valueOf(3)));
  Random rnd = new Random();
  for (int i = 0; i < 100; i++) {
    BigInteger a = new BigInteger(1024, rnd);
    BigInteger b = new BigInteger(1024, rnd);
    assertEquals(a.gcd(b), gcd(a, b));
  }
}