### Question:
TimeSpanUtility { public static String formatTimeSpan(SimpleDateFormat dateFormat, TimeSpan ts) { return ts == null ? BLANK : TimeSpanFormatter.buildString(ts, dateFormat, " to ", new StringBuilder(42)).toString(); } private  TimeSpanUtility(); static String formatTimeSpan(SimpleDateFormat dateFormat, TimeSpan ts); static String formatTimeSpanSingleTimeOnly(SimpleDateFormat dateFormat, TimeSpan ts); static TimeSpan fromStartEnd(long startTime, long endTime); static long getWorkaroundEnd(TimeSpan ts); static long getWorkaroundStart(TimeSpan ts); static final long TIMELESS_END; static final long TIMELESS_START; }### Answer:
@Test public void testFormatTimeSpan() { SimpleDateFormat format = new SimpleDateFormat(DateTimeFormats.DATE_TIME_FORMAT); Assert.assertEquals("", TimeSpanUtility.formatTimeSpan(format, null)); Assert.assertEquals("TIMELESS", TimeSpanUtility.formatTimeSpan(format, TimeSpan.TIMELESS)); Assert.assertEquals("ZERO", TimeSpanUtility.formatTimeSpan(format, TimeSpan.ZERO)); Assert.assertEquals("1970-01-02 00:00:00", TimeSpanUtility.formatTimeSpan(format, TimeSpan.get(Constants.MILLIS_PER_DAY))); Assert.assertEquals("1970-01-02 00:00:00 to 1970-01-03 00:00:00", TimeSpanUtility.formatTimeSpan(format, TimeSpan.get(Constants.MILLIS_PER_DAY, Constants.MILLIS_PER_DAY * 2))); Assert.assertEquals("UNBOUNDED to 1970-01-02 00:00:00", TimeSpanUtility.formatTimeSpan(format, TimeSpan.newUnboundedStartTimeSpan(Constants.MILLIS_PER_DAY))); Assert.assertEquals("1970-01-02 00:00:00 to UNBOUNDED", TimeSpanUtility.formatTimeSpan(format, TimeSpan.newUnboundedEndTimeSpan(Constants.MILLIS_PER_DAY))); }