### Question:
Varint { public static void write(final long value, final ByteBuf bb) { checkRange(value); bb.writeBytes(write(value)); }  static long random(); static long random(final int min); static long readAsLong(final ByteBuf bb); static long readAsLong(final byte[] b); static int readAsInt(final ByteBuf bb); static int readAsInt(final byte[] b); static byte readAsByte(final ByteBuf bb); static void write(final long value, final ByteBuf bb); static byte[] write(final long value); static final long MAX; }### Answer:
@Test public void validateBounds() { final ByteBuf bb = Unpooled.buffer(); Varint.write(0, bb); Varint.write(123, bb); Varint.write(4611686018427387903L, bb); }
@Test(expected = IllegalArgumentException.class) public void validateBoundsTooSmall() { final ByteBuf bb = Unpooled.buffer(); Varint.write(-1, bb); }
@Test(expected = IllegalArgumentException.class) public void validateBoundsTooLarge() { final ByteBuf bb = Unpooled.buffer(); Varint.write(4611686018427387904L, bb); }