### Question:
TimeConverterService { public static String durationToString(final Integer duration) { if (duration == null) { return ERROR_STRING_VALUE; } boolean minus = false; long longValueFromDuration = duration.longValue(); if (longValueFromDuration < 0 ) { minus = true; longValueFromDuration = -longValueFromDuration; } long hours = longValueFromDuration / 3600; long minutes = longValueFromDuration % 3600 / 60; long seconds = longValueFromDuration % 3600 % 60; return (minus ? "-" : "") + ((hours < 10) ? "0" : "") + hours + ":" + ((minutes < 10) ? "0" : "") + minutes + ":" + ((seconds < 10) ? "0" : "") + seconds; }  static String convertTimeToString(final Object duration); static String durationToString(final Integer duration); @Deprecated Date getDateTimeFromField(final Object dateFromField); @Deprecated Object setDateTimeToField(final Date date); @Deprecated Date getDateFromField(final Object dateFromField); @Deprecated Object setDateToField(final Date date);  }### Answer:
@Test public final void shouldConvertDurationToString() { Integer shortDuration = DateTimeConstants.SECONDS_PER_HOUR + DateTimeConstants.SECONDS_PER_MINUTE + 1; Integer longDuration = 2 * DateTimeConstants.SECONDS_PER_DAY + shortDuration; String shortDurationStringVal = TimeConverterService.durationToString(shortDuration); String longDurationStringVal = TimeConverterService.durationToString(longDuration); assertEquals("01:01:01", shortDurationStringVal); assertEquals("49:01:01", longDurationStringVal); }
@Test public final void shouldReturnErrorStringValueIfDurationIsNull() { String strVal = TimeConverterService.durationToString(null); assertEquals("###", strVal); }