DateUtil { static String toFormatAsUTC(final long timestamp) { final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'0000Z'", Locale.US); format.setTimeZone(TimeZone.getTimeZone("UTC")); return format.format(timestamp); }    }
@Test public void toFormatWithZoneTest() { assertWithMessage("Specimen As UTC").that(DateUtil.toFormatAsUTC(1536873803123L)).isEqualTo("2018-09-13T21:23:23.1230000Z"); }