### Question:
Integers { public static String toHexString(int i) { int count = 1, j = i; if (i < 0) { count = 8; } else { while ((j = j >>> 4) != 0) { count++; } } char[] buffer = new char[count]; do { int t = i & 15; if (t > 9) { t = t - 10 + 'a'; } else { t += '0'; } buffer[--count] = (char) t; i = i >>> 4; } while (count > 0); return new String(buffer); }  static int decode(String string); static int parseInt(String string); static int parseInt(String string, int radix); static String toBinaryString(int i); static String toHexString(int i); static String toDecimalString(int value); static String toString(int value); static int highestOneBit(int i); static int lowestOneBit(int i); static int numberOfLeadingZeros(int i); static int numberOfTrailingZeros(int i); static int bitCount(int i); static int rotateLeft(int i, int distance); static int rotateRight(int i, int distance); static int reverseBytes(int i); static int reverse(int i); static int digit(char c, int radix); static final int MAX_VALUE; static final int MIN_VALUE; static final int MIN_RADIX; static final int MAX_RADIX; }### Answer:
@Test public void test_toHexStringI() { String[] hexvals = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}; for (int i = 0; i < 16; i++) { assertTrue("Incorrect string returned " + hexvals[i], Integers.toHexString(i).equals(hexvals[i])); } assertTrue("Returned incorrect hex string: " + Integers.toHexString(Integers.MAX_VALUE), Integers.toHexString( Integers.MAX_VALUE).equals("7fffffff")); assertTrue("Returned incorrect hex string: " + Integers.toHexString(Integers.MIN_VALUE), Integers.toHexString( Integers.MIN_VALUE).equals("80000000")); }