### Question:
Bytes { public static int normalize(int i, int bitCount) { int max = 0xffffffff >>> (32 - bitCount); if (i > max) { throw new IllegalArgumentException("The integer cannot fit to bit boundaries."); } if (i > (max >>> 1)) { return i - (max + 1); } else { return i; } }  static byte[] toByteArray(int... uints); static int toInt(byte[] pb, boolean bigEndian); static int normalize(int i, int bitCount); static void normalize(int iarr[], int bitCount); static byte[] toByteArray(int i, int size, boolean isBigEndian); static int toInt(byte b0, byte b1, byte b2, byte b3, boolean bigEndian); static byte[] toByteArray(int i, boolean bigEndian); static byte[] toByteArray(short i, boolean bigEndian); static int[] toIntArray(byte[] ba, int amount, boolean bigEndian); static int[] toIntArray(byte[] ba, final int amount, final int bytePerInteger,
      boolean bigEndian); static int[] toReducedBitIntArray(
      byte[] ba,
      final int amount,
      int bytePerInteger,
      int bitAmount,
      boolean bigEndian); static short[] toShortArray(byte[] ba, int amount, boolean bigEndian); static byte[] toByteArray(short[] sa, int amount, boolean bigEndian); static byte[] toByteArray(int[] ia, int amount, int bytePerInteger, boolean bigEndian); static String toHexWithZeros(byte b); static String toHex(byte b); static String toHex(byte[] bytes); static String toHexWithZeros(byte[] bytes); static void hexDump(OutputStream os, byte[] bytes, int columns); static void hexDump(byte[] bytes, int columns); static final byte[] EMPTY_BYTE_ARRAY; }### Answer:
@Test public void testNormalize() { assertEquals(Bytes.normalize(0xff, 8), -1); assertEquals(Bytes.normalize(0x8000, 16), Short.MIN_VALUE); }