### Question:
ByteUtils { public static byte[] longToByteArray(long value) { return new byte[] { (byte)((value >>> 56) & 0xFF), (byte)((value >>> 48) & 0xFF), (byte)((value >>> 40) & 0xFF), (byte)((value >>> 32) & 0xFF), (byte)((value >>> 24) & 0xFF), (byte)((value >>> 16) & 0xFF), (byte)((value >>> 8) & 0xFF), (byte)(value & 0xFF) }; }  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 testLongToByteArray() { long l = 0x1234859623475620L; byte[] expectedResult = new byte[]{0x12, 0x34, (byte)0x85, (byte)0x96, 0x23, 0x47, 0x56, 0x20}; byte[] result = ByteUtils.longToByteArray(l); assertThat("Returned byte array must be equal to 'expectedResult'", result, is(equalTo(expectedResult))); }