@Test public void testRoundTrips() { Random random = new Random(); for (int i = 0; i < 10000; ++i) { long value = RandomNumberUtils.nextPositiveLong(random); byte[] bytes = UVLongTool.getBytes(value); long roundTripped = UVLongTool.getLong(bytes); Assert.assertEquals(value, roundTripped); int calculatedNumBytes = UVLongTool.numBytes(value); int actualNumBytes = bytes.length; Assert.assertEquals(actualNumBytes, calculatedNumBytes); } }