public static String toHumanReadable(long size) {
        if (size < 0)
            return String.valueOf(size);
        if (size >= EB)
            return formatSize(size, EB, "EB");
        if (size >= PB)
            return formatSize(size, PB, "PB");
        if (size >= TB)
            return formatSize(size, TB, "TB");
        if (size >= GB)
            return formatSize(size, GB, "GB");
        if (size >= MB)
            return formatSize(size, MB, "MB");
        if (size >= KB)
            return formatSize(size, KB, "KB");
        return formatSize(size, BYTE, "B");
    }
@Test
    public void toHumanReadableTest() {
        Map<Long, String> capacityTable = new HashMap<Long, String>() {
            {
                put(-1L, "-1");
                put(0L, "0B");
                put(1023L, "1023B");
                put(1024L, "1KB");
                put(12_345L, "12.06KB");
                put(10_123_456L, "9.65MB");
                put(10_123_456_798L, "9.43GB");
                put(123 * 1024L * 1024L * 1024L * 1024L, "123TB");
                put(123 * 1024L * 1024L * 1024L * 1024L * 1024L, "123PB");
                put(1_777_777_777_777_777_777L, "1.54EB");
            }
        };
        capacityTable.forEach((in, expected) ->
            Assert.assertEquals(expected, MessageStoreUtil.toHumanReadable(in)));
    }