### Question:
ISO8601DateFormatter extends DateFormat { @Override public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { toAppendTo.append(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(DateUtil.toOffsetDateTime(date))); return toAppendTo; }  @Override StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition); @Override Date parse(String source, ParsePosition pos);  }### Answer:
@Test public void testFormat() { OffsetDateTime offsetDateTime = OffsetDateTime.of( 2018, 11, 30, 2, 30, 11, 0, ZoneOffset.ofHoursMinutes(1, 30)); String text = new ISO8601DateFormatter().format(Date.from(offsetDateTime.toInstant())); assertThat(text, is("2018-11-30T01:00:11Z")); }