### Question:
TimeUtils { public static String getPeriodString(long period) { StringBuilder str = new StringBuilder("P"); long days = period / MILLIS_PER_DAY; if (days > 0) { str.append(days + "D"); period -= days * MILLIS_PER_DAY; } if (period > 0) str.append("T"); long hours = period / MILLIS_PER_HOUR; if (hours > 0) { str.append(hours + "H"); period -= hours * MILLIS_PER_HOUR; } long minutes = period / MILLIS_PER_MINUTE; if (minutes > 0) { str.append(minutes + "M"); period -= minutes * MILLIS_PER_MINUTE; } if (period > 0) { long seconds = period / MILLIS_PER_SECOND; long millis = period % MILLIS_PER_SECOND; str.append(seconds); if (millis > 0) str.append("." + addOrRemoveZeros(millis)); str.append("S"); } return str.toString(); } private  TimeUtils(); static String dateTimeToISO8601(DateTime dateTime); static DateTime iso8601ToDateTime(String isoDateTime, Chronology chronology); static int findTimeIndex(List<DateTime> dtList, DateTime target); static String formatUtcIsoTimeOnly(DateTime dateTime); static String formatUtcTimeOnly(DateTime dateTime); static String formatUtcHumanReadableDateTime(DateTime dateTime); static String formatUtcDateOnly(DateTime dateTime); static String getTimeStringForCapabilities(List<DateTime> times); static String getPeriodString(long period); static Extent<DateTime> getTimeRangeForString(String timeString, Chronology chronology); static boolean onSameDay(DateTime dt1, DateTime dt2); static int getUnitLengthSeconds(String unit); static final Comparator<DateTime> TIME_POSITION_COMPARATOR; }### Answer:
@Test public void testGetPeriodString() { long secondPeriod = 44 * MILLIS_PER_SECOND; assertEquals("PT44S", TimeUtils.getPeriodString(secondPeriod)); long minutePeriod = 15 * MILLIS_PER_MINUTE + secondPeriod; assertEquals("PT15M44S", TimeUtils.getPeriodString(minutePeriod)); long hourPeriod = 20 * MILLIS_PER_HOUR + minutePeriod; assertEquals("PT20H15M44S", TimeUtils.getPeriodString(hourPeriod)); long dayPeriod = 3 * MILLIS_PER_DAY + hourPeriod; assertEquals("P3DT20H15M44S", TimeUtils.getPeriodString(dayPeriod)); }