### Question:
ProtoUtils { public static byte[] convertIntToByteArray(int value) { int originValue = value; int size = 0; if (value < 0) { value = -value; } while (value > sizeTable[size]) size++; size++; if (originValue < 0) size++; int q, r; byte[] buf = new byte[size]; if (originValue < 0) { buf[0] = '-'; } int charPos = size; while (value >= 65536) { q = value / 100; r = value - ((q << 6) + (q << 5) + (q << 2)); value = q; buf[--charPos] = DigitOnes[r]; buf[--charPos] = DigitTens[r]; } for (;;) { q = (value * 52429) >>> (16 + 3); r = value - ((q << 3) + (q << 1)); buf[--charPos] = digits[r]; value = q; if (value == 0) break; } return buf; }  static byte[] convertIntToByteArray(int value); static byte[] buildErrorReplyBytes(String message); static int readInt(ByteBuf buffer); static final byte[] OK; static final byte[] PONG; static final byte[] ERR_NO_AUTH; static final byte[] ERR_NO_AUTH_PASSWORD; static final byte[] ERR_NO_AUTH_NO_PASSWORD; static final byte[] ERR_PIPELINE_BACKEND; static final byte[] ERR_INVALID_COMMAND; static final byte[] ERROR_ERR_BULK; static final byte[] WRONGTYPE_ERR_BULK; static final byte[] NOIMPLEMENT_ERR_BULK; }### Answer:
@Test public void convertIntToByteArray() { int a = -100; byte[] result = ProtoUtils.convertIntToByteArray(a); assertEquals(4,result.length); assertEquals('-',result[0]); assertEquals('1',result[1]); assertEquals('0',result[2]); assertEquals('0',result[3]); a = 100; result = ProtoUtils.convertIntToByteArray(a); assertEquals(3,result.length); assertEquals('1',result[0]); assertEquals('0',result[1]); assertEquals('0',result[2]); }