GeneralizedTimeValueTranscoder extends AbstractStringValueTranscoder<ZonedDateTime> { @Override public String encodeStringValue(final ZonedDateTime value) { if (value.getZone().normalized().equals(ZoneOffset.UTC)) { return value.format(DATE_FORMAT); } else { return value.withZoneSameInstant(ZoneOffset.UTC).format(DATE_FORMAT); } }  @Override ZonedDateTime decodeStringValue(final String value); @Override String encodeStringValue(final ZonedDateTime value); @Override Class<ZonedDateTime> getType();  }
@Test(groups = "transcode", dataProvider = "dates") public void encodeFormat(final ZonedDateTime date, final String generalizedTime, final String formatTime) throws Exception { Assert.assertEquals(transcoder.encodeStringValue(date), formatTime); }