ZonedDateTimeToLocalDateTimeConverter implements Converter<LocalDateTime, ZonedDateTime> { @Override public LocalDateTime convertToPresentation(ZonedDateTime value, ValueContext context) { if (value == null) { return null; } return value.toLocalDateTime(); } ZonedDateTimeToLocalDateTimeConverter(ZoneId zoneId); @Override Result<ZonedDateTime> convertToModel(LocalDateTime value, ValueContext context); @Override LocalDateTime convertToPresentation(ZonedDateTime value, ValueContext context);  }
@Test public void testConvertToPresentation() { assertNull(converter.convertToPresentation(null, createContext())); ZonedDateTime zdt = ZonedDateTime.of(LocalDateTime.of(LocalDate.of(2014, 12, 11), LocalTime.of(12, 11)), ZoneId.systemDefault()); LocalDateTime ldt = converter.convertToPresentation(zdt, createContext()); assertEquals(zdt.toLocalDateTime(), ldt); }