### Question:
TimeInstant implements Comparable<TimeInstant>, Serializable, SizeProvider { public String toISO8601String() { return DateTimeUtilities.generateISO8601DateString(toDate()); }  static TimeInstant get(); static TimeInstant get(Calendar time); static TimeInstant get(Date time); static TimeInstant get(long epochMillis); static TimeInstant max(TimeInstant t1, TimeInstant t2); static TimeInstant min(TimeInstant t1, TimeInstant t2); @Override int compareTo(TimeInstant o); @Override boolean equals(Object obj); abstract long getEpochMillis(); @Override int hashCode(); boolean isAfter(TimeInstant other); boolean isBefore(TimeInstant other); boolean isOverlapped(Collection<? extends TimeSpan> timeSpans); TimeInstant minus(Duration dur); Duration minus(TimeInstant other); TimeInstant plus(Duration dur); Date toDate(); String toDisplayString(); String toDisplayString(String fmt); String toISO8601String(); @Override String toString();  }### Answer:
@Test public void testToISO8601String() throws ParseException { SimpleDateFormat fmt = new SimpleDateFormat(DateTimeFormats.DATE_TIME_FORMAT); TimeInstant timeInstant = TimeInstant.get(fmt.parse("2010-03-13 12:35:17")); String actual = timeInstant.toISO8601String(); String expected = "2010-03-13T12:35:17Z"; Assert.assertEquals(expected, actual); fmt = new SimpleDateFormat(DateTimeFormats.DATE_TIME_MILLIS_FORMAT); timeInstant = TimeInstant.get(fmt.parse("2010-03-13 12:35:17.001")); actual = timeInstant.toISO8601String(); expected = "2010-03-13T12:35:17.001Z"; Assert.assertEquals(expected, actual); }