DateHelper { public static OffsetDateTime toOffsetDateTime(final DateTime dateTime) { return Instant.ofEpochMilli(dateTime.getMillis()).atOffset(ZoneOffset.UTC); } private  DateHelper(); @Nullable static Date copy(@Nullable final Date date); @Nullable static DateTime toDateTime(@Nullable final Date date); @Nullable static Date toDate(@Nullable final DateTime dateTime); static DateTime toDateTime(final OffsetDateTime offsetDateTime); static OffsetDateTime toOffsetDateTime(final DateTime dateTime); static Duration toJavaDuration(final org.joda.time.Duration jodaDuration); static org.joda.time.Duration toJodaDuration(final Duration javaDuration);  }
@Test public void toOffsetDateTimeTest() { OffsetDateTime offsetDateTime = OffsetDateTime.parse("2010-06-30T01:20+00:00"); DateTime jodaDateTime = new DateTime("2010-06-30T01:20+00:00"); assertThat(toOffsetDateTime(jodaDateTime).toInstant(), equalTo(offsetDateTime.toInstant())); }