public static void writeUnsignedVarlong(long v, ByteBuffer buffer) {
        while ((v & 0xffffffffffffff80L) != 0L) {
            byte b = (byte) ((v & 0x7f) | 0x80);
            buffer.put(b);
            v >>>= 7;
        }
        buffer.put((byte) v);
    }
@Test
    @Disabled // Enable this when we change the implementation of UnsignedVarlong
    public void testCorrectnessWriteUnsignedVarlong() {
        // The old well-known implementation for writeVarlong.
        LongFunction<ByteBuffer> simpleImplementation = (long value) -> {
            ByteBuffer buffer = ByteBuffer.allocate(MAX_LENGTH_VARLONG);
            while ((value & 0xffffffffffffff80L) != 0L) {
                byte b = (byte) ((value & 0x7f) | 0x80);
                buffer.put(b);
                value >>>= 7;
            }
            buffer.put((byte) value);

            return buffer;
        };

        // compare the full range of values
        final ByteBuffer actual = ByteBuffer.allocate(MAX_LENGTH_VARLONG);
        for (long i = 1; i < Long.MAX_VALUE && i >= 0; i = i << 1) {
            ByteUtils.writeUnsignedVarlong(i, actual);
            final ByteBuffer expected = simpleImplementation.apply(i);
            assertArrayEquals(expected.array(), actual.array(), "Implementations do not match for number=" + i);
            actual.clear();
        }
    }