### Question:
VariableLengthQuantity { public static void writeVariableLengthInt(int value, SliceOutput sliceOutput) { int highBitMask = 0x80; if (value < (1 << 7) && value >= 0) { sliceOutput.writeByte(value); } else if (value < (1 << 14) && value > 0) { sliceOutput.writeByte(value | highBitMask); sliceOutput.writeByte(value >>> 7); } else if (value < (1 << 21) && value > 0) { sliceOutput.writeByte(value | highBitMask); sliceOutput.writeByte((value >>> 7) | highBitMask); sliceOutput.writeByte(value >>> 14); } else if (value < (1 << 28) && value > 0) { sliceOutput.writeByte(value | highBitMask); sliceOutput.writeByte((value >>> 7) | highBitMask); sliceOutput.writeByte((value >>> 14) | highBitMask); sliceOutput.writeByte(value >>> 21); } else { sliceOutput.writeByte(value | highBitMask); sliceOutput.writeByte((value >>> 7) | highBitMask); sliceOutput.writeByte((value >>> 14) | highBitMask); sliceOutput.writeByte((value >>> 21) | highBitMask); sliceOutput.writeByte(value >>> 28); } } private  VariableLengthQuantity(); static int variableLengthSize(int value); static int variableLengthSize(long value); static void writeVariableLengthInt(int value, SliceOutput sliceOutput); static void writeVariableLengthLong(long value, SliceOutput sliceOutput); static int readVariableLengthInt(SliceInput sliceInput); static int readVariableLengthInt(ByteBuffer sliceInput); static long readVariableLengthLong(SliceInput sliceInput);  }### Answer:
@Test public void testWriteVariableLengthInt() { testVariableLengthInt(0x0); testVariableLengthInt(0xf); testVariableLengthInt(0xff); testVariableLengthInt(0xfff); testVariableLengthInt(0xffff); testVariableLengthInt(0xfffff); testVariableLengthInt(0xffffff); testVariableLengthInt(0xfffffff); testVariableLengthInt(0xffffffff); }