### Question:
R4DateTimeDhisToFhirTransformerUtils extends AbstractDateTimeDhisToFhirTransformerUtils { @Nullable @Override public IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ) { final LocalDateTime date = castDateTime( dateTime ); if ( date == null ) { return null; } return new DateTimeType( Date.from( date.atZone( zoneId ).toInstant() ), TemporalPrecisionEnum.MILLI ); } R4DateTimeDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Nullable @Override IPrimitiveType<Date> getPreciseDateElement( @Nullable Object dateTime ); @Nullable @Override IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ); @Nullable @Override IPrimitiveType<Date> getDayDateTimeElement( @Nullable Object dateTime );  }### Answer:
@Test public void getDateTimeElementNull() { Assert.assertNull( utils.getDateTimeElement( null ) ); }
@Test public void getDateTimeElementDate() { final Date date = new Date(); Assert.assertEquals( new DateTimeType( date, TemporalPrecisionEnum.MILLI ).getValueAsString(), Objects.requireNonNull( utils.getDateTimeElement( date ) ).getValueAsString() ); }
@Test public void getDateTimeElementLocalDateTime() { final Date date = new Date(); Assert.assertEquals( new DateTimeType( date, TemporalPrecisionEnum.MILLI ).getValueAsString(), Objects.requireNonNull( utils.getDateTimeElement( LocalDateTime.ofInstant( date.toInstant(), ZoneId.systemDefault() ) ) ).getValueAsString() ); }
@Test public void getDateTimeElementElement() { final Date date = new Date(); Assert.assertEquals( new DateTimeType( date, TemporalPrecisionEnum.MILLI ).getValueAsString(), Objects.requireNonNull( utils.getDateTimeElement( new DateTimeType( date ) ) ).getValueAsString() ); }