PeriodFormatterUtil { public static String toStandardUptimeStyleString(long durationInMillis) { return getStandardUptimeStyle().print(createDayHourMinSecPeriod(durationInMillis)); }  static PeriodType getDayHourMinSecPeriodType(); static Period createDayHourMinSecPeriod(long durationInMillis); static PeriodFormatter getLinuxUptimeStyle(); static PeriodFormatter getStandardUptimeStyle(); static String toLinuxUptimeStyleString(long durationInMillis); static String toStandardUptimeStyleString(long durationInMillis);  }
@Test public void standardUptimeStyle() throws Exception { Assert.assertEquals("8 days 8 hours 9 mins 27 secs", PeriodFormatterUtil.toStandardUptimeStyleString(UPTIME_LESS_THAN_9_DAYS)); Assert.assertEquals("2 days 12 hours 2 mins 50 secs", PeriodFormatterUtil.toStandardUptimeStyleString(UPTIME_LESS_THAN_3_DAYS)); Assert.assertEquals("1 day 22 hours 24 mins 48 secs", PeriodFormatterUtil.toStandardUptimeStyleString(UPTIME_LESS_THAN_2_DAYS)); Assert.assertEquals("0 days 20 hours 0 mins 56 secs", PeriodFormatterUtil.toStandardUptimeStyleString(UPTIME_LESS_THAN_1_DAY)); Assert.assertEquals("0 days 0 hours 0 mins 53 secs", PeriodFormatterUtil.toStandardUptimeStyleString(UPTIME_53_SECS)); }