### Question:
ByteUtils { public static byte[] shortToByteArray(short value) { byte[] b = new byte[2]; b[0] = (byte)((value >> 8) & 0xFF); b[1] = (byte)(value & 0xFF); return b; }  static byte[] readBytes(int numBytes, ByteArrayInputStream inputStream); static String readString(ByteArrayInputStream inputStream); static byte[] longToByteArray(long value); static long byteArrayToLong(byte[] byteArray); static byte[] intToByteArray(int value); static int byteArrayToInt(byte[] byteArray); static byte[] shortToByteArray(short value); static short byteArrayToShort(byte[] byteArray); static byte[] stringToByteArray(String value); static String byteArrayToString(byte[] value); static int byteToInt(byte b); static boolean isBitEnabled(int containerInteger, int bitPosition); static int readIntegerFromByte(byte containerByte, int bitOffset, int bitLength); static boolean readBooleanFromByte(byte containerByte, int bitOffset); static byte[] readUntilCR(ByteArrayInputStream inputStream); static byte[] newByteArray(byte[] data, int finalSize); static byte[] swapByteArray(byte[] source);  }### Answer:
@Test public final void testShortToByteArray() { short s = 0x7FFF; byte[] expectedResult = new byte[]{0x7F, (byte)0xFF}; byte[] result = ByteUtils.shortToByteArray(s); assertThat("Returned byte array must be equal to 'expectedResult'", result, is(equalTo(expectedResult))); }