@Test
  public void testDivideDestructiveInt() {
    two.divideDestructive(1);
    assertEquals(1L, one.longValue());
    assertEquals(2L, two.longValue());
    one.divideDestructive(2);
    assertEquals(0L, one.longValue());
    assertEquals(2L, two.longValue());

    SignedInt128 var1 = new SignedInt128(1234234662345L);
    var1.divideDestructive(642337);
    assertEquals(1234234662345L / 642337L, var1.longValue());

    SignedInt128 complicated1 = new SignedInt128(0xF9892FCA, 0x59D109AD,
        0x0534AB4C, 0);
    BigInteger bigInteger1 = complicated1.toBigIntegerSlow();
    complicated1.divideDestructive(1534223465);
    BigInteger bigInteger2 = BigInteger.valueOf(1534223465);
    BigInteger ans = bigInteger1.divide(bigInteger2);
    assertEquals(ans, complicated1.toBigIntegerSlow());

    try {
      complicated1.divideDestructive(0);
      fail();
    } catch (ArithmeticException ex) {
      // ok
    }
  }
Testcases for {@link SignedInt128}

This code was based on code from Microsoft PolyBase.
common/src/test/org/apache/hadoop/hive/common/type/TestSignedInt128.java