public static String convertMsToClockTime(long millis) {
    Preconditions.checkArgument(millis >= 0,
        "Negative values %s are not supported to convert to clock time.", millis);

    long days = millis / Constants.DAY_MS;
    long hours = (millis % Constants.DAY_MS) / Constants.HOUR_MS;
    long mins = (millis % Constants.HOUR_MS) / Constants.MINUTE_MS;
    long secs = (millis % Constants.MINUTE_MS) / Constants.SECOND_MS;

    return String.format("%d day(s), %d hour(s), %d minute(s), and %d second(s)", days, hours,
        mins, secs);
  }
@Test
  public void convertMsToClockTime() {
    assertEquals("0 day(s), 0 hour(s), 0 minute(s), and 0 second(s)",
        CommonUtils.convertMsToClockTime(10));
    assertEquals("0 day(s), 0 hour(s), 0 minute(s), and 1 second(s)",
        CommonUtils.convertMsToClockTime(TimeUnit.SECONDS.toMillis(1)));
    assertEquals("0 day(s), 0 hour(s), 1 minute(s), and 0 second(s)",
        CommonUtils.convertMsToClockTime(TimeUnit.MINUTES.toMillis(1)));
    assertEquals("0 day(s), 0 hour(s), 1 minute(s), and 30 second(s)",
        CommonUtils.convertMsToClockTime(TimeUnit.MINUTES.toMillis(1)
            + TimeUnit.SECONDS.toMillis(30)));
    assertEquals("0 day(s), 1 hour(s), 0 minute(s), and 0 second(s)",
        CommonUtils.convertMsToClockTime(TimeUnit.HOURS.toMillis(1)));
    long time =
        TimeUnit.DAYS.toMillis(1) + TimeUnit.HOURS.toMillis(4) + TimeUnit.MINUTES.toMillis(10)
            + TimeUnit.SECONDS.toMillis(45);
    String out = CommonUtils.convertMsToClockTime(time);
    assertEquals("1 day(s), 4 hour(s), 10 minute(s), and 45 second(s)", out);
  }