### Question:
TorrentUtils { public static String byteArrayToHexString(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int j = 0; j < bytes.length; j++) { int v = bytes[j] & 0xFF; hexChars[j * 2] = HEX_SYMBOLS[v >>> 4]; hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F]; } return new String(hexChars); }  static byte[] calculateSha1Hash(byte[] data); static String byteArrayToHexString(byte[] bytes); static boolean isTrackerLessInfo(AnnounceableInformation information); static List<String> getTorrentFileNames(TorrentMetadata metadata);  }### Answer:
@Test(expectedExceptions = NullPointerException.class) public void testBytesToHexWithNull() { TorrentUtils.byteArrayToHexString(null); }
@Test public void testBytesToHexWithEmptyByteArray() { assertEquals("", TorrentUtils.byteArrayToHexString(new byte[0])); }
@Test public void testBytesToHexWithSingleByte() { assertEquals("BC", TorrentUtils.byteArrayToHexString(new byte[]{ (byte) 0xBC })); }
@Test public void testBytesToHexWithZeroByte() { assertEquals("00", TorrentUtils.byteArrayToHexString(new byte[1])); }
@Test public void testBytesToHexWithLeadingZero() { assertEquals("0053FF", TorrentUtils.byteArrayToHexString(new byte[]{ (byte) 0x00, (byte) 0x53, (byte) 0xFF })); }
@Test public void testBytesToHexTrailingZero() { assertEquals("AA004500", TorrentUtils.byteArrayToHexString(new byte[]{ (byte) 0xAA, (byte) 0x00, (byte) 0x45, (byte) 0x00 })); }
@Test public void testBytesToHexAllSymbols() { assertEquals("0123456789ABCDEF", TorrentUtils.byteArrayToHexString(new byte[]{ (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67, (byte) 0x89, (byte) 0xAB, (byte) 0xCD, (byte) 0xEF })); }