### Question:
DateUtils { public static String toUTCDateFormatWithMilliseconds(final Date date) { return dateToString(date, UTC_DATE_MILLISECONDS_Z_FORMAT, UTC_TIME_ZONE); }  static String dateToString(final Date date); static String toUTCDateFormat(final Date date); static String toUTCDateFormatWithMilliseconds(final Date date); static String toFullLocalDateFormat(final Date date); static Date stringToDate(String strDate);  }### Answer:
@Test public void testToUTCDateFormatWithMilliseconds() { String have = DateUtils.toUTCDateFormatWithMilliseconds(dateWithoutMilliseconds); SimpleDateFormat sdf = utcSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); String expect = sdf.format(dateWithoutMilliseconds); assertThat(have).isEqualTo(expect); have = DateUtils.toUTCDateFormatWithMilliseconds(dateWithMilliseconds); expect = sdf.format(dateWithMilliseconds); assertThat(have).isEqualTo(expect); assertThat(DateUtils.toUTCDateFormatWithMilliseconds(dateWithoutMilliseconds)) .isNotEqualTo(DateUtils.toUTCDateFormatWithMilliseconds(dateWithMilliseconds)); }