### Question:
ZonedDateTimeUTCtoEuropeConverter extends TypeConverter implements SimpleValueConverter { @Override public Object encode(Object value, MappedField optionalExtraInfo) { if (value == null || !(value instanceof ZonedDateTime)) { return null; } ZonedDateTime zonedDateTimeEurope = (ZonedDateTime) value; Date date = new Date(); date.setTime(zonedDateTimeEurope.toInstant().toEpochMilli()); return date; } ZonedDateTimeUTCtoEuropeConverter(); @Override Object encode(Object value, MappedField optionalExtraInfo); @Override Object decode(Class<?> targetClass, Object fromDBObject, MappedField optionalExtraInfo);  }### Answer:
@Test public void testEncodingTheZonedDateToUTC() { ZonedDateTime testDateTime = ZonedDateTime.of(2017, 6, 20, 0, 0, 0, 0, ZoneId.of("Europe/Paris")); ZonedDateTimeUTCtoEuropeConverter cut = new ZonedDateTimeUTCtoEuropeConverter(); final Object encode = cut.encode(testDateTime, null); assertThat(encode, instanceOf(Date.class)); assertThat(((Date)encode).getTime(), is(testDateTime.toInstant().atZone(ZoneId.of("UTC")).toEpochSecond()*1000)); }