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