public static String asString(Duration duration) {

        long numDays = duration.toDays();
        long numHours = duration.toHours() % 24;
        long numMinutes = duration.toMinutes() % 60;
        long numSeconds = duration.getSeconds() % 60;

        String output = String.format("%d:%02d:%02d", numHours, numMinutes, numSeconds);

        if (numDays > 0L) {
            return numDays + " days, " + output;
        } else {
            return output;
        }
    }
@Test
    public void testDurationFormatting_1() {

        //13 hours, 22 minutes, and 15 seconds
        long numSeconds = 13 * 3600 + 22 * 60 + 15;

        Duration dur = Duration.ofSeconds(numSeconds);

        assertEquals(
            "13:22:15",
            TimeUtils.asString(dur)
        );
    }