DateUtil { public static synchronized String iso8601DateFormat(Date date) { return getCachedDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ROOT, true).format(date); } private  DateUtil(); static synchronized String iso8601DateFormat(Date date); static synchronized Date iso8601DateParse(String date); static synchronized String iso8601LocalDateFormat(Date date); static String getMonthOnlyDateString(@NonNull Date date); static String getMonthOnlyWithoutDayDateString(@NonNull Date date); static String getExtraShortDateString(@NonNull Date date); static synchronized String getDateStringWithSkeletonPattern(@NonNull Date date, @NonNull String pattern); static String getShortDateString(@NonNull Context context, @NonNull Date date); static UtcDate getUtcRequestDateFor(int age); static Calendar getDefaultDateFor(int age); static synchronized Date getHttpLastModifiedDate(@NonNull String dateStr); static String getReadingListsLastSyncDateString(@NonNull String dateStr); @NonNull static String yearToStringWithEra(int year);  }
@Test public void testIso8601DateFormat() throws Throwable { assertThat(DateUtil.iso8601DateFormat(DateUtil.getHttpLastModifiedDate(HTTP_DATE_HEADER)), is("2017-05-25T21:13:47Z")); }