### Question:
SignalUtil { public static byte[] twoBytesFromInt(int n) { if(n > (2 << 15)-1) { throw new IllegalArgumentException("Nr can not fit in two bytes, was" + n); } else if(n < 0) { throw new IllegalArgumentException("Nr can not be below zero, was" + n); } else { ByteBuffer buff = ByteBuffer.allocate(Integer.BYTES); buff.putInt(n); return Arrays.copyOfRange(buff.array(),2,4); } }  static int intFromTwoBytes(byte[] bytes); static byte[] fourBytesFromInt(int n); static byte[] twoBytesFromInt(int n); static int intFromFourBytes(byte[] bytes); static int unsign(byte by); static byte sign(int by); static byte[] joinBytesArrays(byte[]... args); static byte[] joinBytesArrays(List<byte[]> args); static int multipleOfFour(int start); static byte[] xor(byte[] a, byte[] b); static long computeCRC32(byte[] bytes); static long computeCRC32c(byte[] bytes); static byte[] flipBytes(byte[] bytes); static byte[] longToFourBytes(long l); static byte[] longToFourBytesFlip(long l); static byte[] longToBytes(long l); static byte[] padToMultipleOfFour(byte[] bytes); static long bytesToLong(byte[] l); static byte[] md5key(byte[] key); static byte[] hmacSha1(byte[] data, byte[] key); static ByteRange range(int a, int b); static byte[] copyRange(byte[] bytes,ByteRange range); static List<byte[]> split(byte[] data,int chunkSize); static byte[] randomBytes(int lgt);  }### Answer:
@Test public void testByteConvert() { byte[] bt = SignalUtil.twoBytesFromInt((2 << 15)-1); assertEquals(-1,bt[0]); assertEquals(-1,bt[1]); bt = SignalUtil.twoBytesFromInt(0); assertEquals(0,bt[0]); assertEquals(0,bt[1]); bt = SignalUtil.twoBytesFromInt(511); assertEquals(1,bt[0]); assertEquals(-1,bt[1]); }