### Question:
FragmentStats { public static String dataToString(FragmentStats stats, String datapath) { return "Statistics information for \"" + datapath + "\" " + " Number of Fragments: " + stats.fragmentsNumber + ", first Fragment size: " + stats.firstFragmentSize + ", total size: " + stats.totalSize; } FragmentStats(long fragmentsNumber, long firstFragmentSize,
                         long totalSize); static String dataToJSON(FragmentStats stats); static String dataToString(FragmentStats stats, String datapath); long getFragmentsNumber(); SizeAndUnit getFirstFragmentSize(); SizeAndUnit getTotalSize(); static final long DEFAULT_FRAGMENT_SIZE; }### Answer:
@Test public void dataToString() { FragmentStats fragmentStats = new FragmentStats(25, 2000000000, (long) Math.pow(5, 30)); String path = "la la la"; String str = FragmentStats.dataToString(fragmentStats, path); String expected = "Statistics information for \"" + path + "\" " + " Number of Fragments: " + 25 + ", first Fragment size: " + 1953125 + "KB" + ", total size: " + 8388607 + "TB"; assertEquals(expected, str); }