### Question:
FileUtil { public static String formatFileSize(long theBytes) { if (theBytes <= 0) { return "0 " + UNITS[0]; } int digitGroups = (int) (Math.log10(theBytes) / Math.log10(1024)); digitGroups = Math.min(digitGroups, UNITS.length - 1); return new DecimalFormat("###0.#").format(theBytes / Math.pow(1024, digitGroups)) + " " + UNITS[digitGroups]; }  static String formatFileSize(long theBytes);  }### Answer:
@Test public void formatFileSize() { assertEquals("0 Bytes", FileUtil.formatFileSize(0).replace(",", ".")); assertEquals("1 Bytes", FileUtil.formatFileSize(1).replace(",", ".")); assertEquals("1.2 kB", FileUtil.formatFileSize(1234).replace(",", ".")); assertEquals("12.1 kB", FileUtil.formatFileSize(12345).replace(",", ".")); assertEquals("11.8 MB", FileUtil.formatFileSize(12345678).replace(",", ".")); assertEquals("103.5 GB", FileUtil.formatFileSize(111111111111L).replace(",", ".")); assertEquals("101.1 TB", FileUtil.formatFileSize(111111111111111L).replace(",", ".")); assertEquals("10105.5 TB", FileUtil.formatFileSize(11111111111111111L).replace(",", ".")); }