Json { @SuppressWarnings("ConstantConditions") public static ZonedDateTime zonedDateTimeFromJson(String dt) { if(nonNull(dt)) { try { return ZonedDateTime.parse(dt, FORMATTER); } catch(DateTimeException e) { return null; } } return null; }  static String toJson(ZonedDateTime dt); @SuppressWarnings("ConstantConditions") static ZonedDateTime zonedDateTimeFromJson(String dt);  }
@Test public void zonedDateTimeFromJson() throws Exception { assertThat(Json.zonedDateTimeFromJson(null), nullValue()); assertThat(Json.zonedDateTimeFromJson("*%#!"), nullValue()); }