@Test
  public void testToFormalString() {
    assertEquals("0", zero.toFormalString());
    assertEquals("1", one.toFormalString());

    assertEquals("30", new UnsignedInt128(30).toFormalString());
    assertEquals("680000000000",
        new UnsignedInt128(680000000000L).toFormalString());
    assertEquals("6800000000000",
        new UnsignedInt128(6800000000000L).toFormalString());
    assertEquals("68", new UnsignedInt128(68).toFormalString());

    assertEquals(zero, new UnsignedInt128("0"));
    assertEquals(one, new UnsignedInt128("1"));

    assertEquals(new UnsignedInt128(30), new UnsignedInt128("30"));
    assertEquals(new UnsignedInt128(680000000000L), new UnsignedInt128(
        "680000000000"));
    assertEquals(new UnsignedInt128(6800000000000L), new UnsignedInt128(
        "6800000000000"));
    assertEquals(new UnsignedInt128(68), new UnsignedInt128("68"));
  }
Testcases for {@link UnsignedInt128}

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