TimeUtil { public static Instant toJoda(java.time.Instant instant) { return Optional.ofNullable(instant).map(t -> new Instant(t.toEpochMilli())).orElse(null); } private  TimeUtil(); static java.time.Instant toJava(Instant timestamp); static Instant toJoda(java.time.Instant instant);  }
@Test public void shouldConvertToJodaInstant() { assertThat(TimeUtil.toJoda(null)).isNull(); assertThat(TimeUtil.toJoda(java.time.Instant.ofEpochMilli(0L))) .isEqualTo(org.joda.time.Instant.ofEpochMilli(0L)); }