### Question:
Dstu3DateTimeDhisToFhirTransformerUtils extends AbstractDateTimeDhisToFhirTransformerUtils { @Nullable @Override public IPrimitiveType<Date> getPreciseDateElement( @Nullable Object dateTime ) { final LocalDate date = castDate( dateTime ); if ( date == null ) { return null; } return new DateType( Date.from( date.atStartOfDay( zoneId ).toInstant() ), TemporalPrecisionEnum.DAY ); } Dstu3DateTimeDhisToFhirTransformerUtils( @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 getPreciseDateElementMonthPrecision() { final DateTimeType dateTimeDt = new DateTimeType( new Date(), TemporalPrecisionEnum.MONTH ); Assert.assertNull( utils.getPreciseDateElement( dateTimeDt ) ); }
@Test public void getPreciseDateElementDayPrecision() { final DateTimeType dateTimeDt = new DateTimeType( new Date(), TemporalPrecisionEnum.DAY ); Assert.assertEquals( new DateType( new Date() ).getValueAsString(), Objects.requireNonNull( utils.getPreciseDateElement( dateTimeDt ) ).getValueAsString() ); }
@Test public void getPreciseDateElementDate() { Assert.assertEquals( new DateType( new Date() ).getValueAsString(), Objects.requireNonNull( utils.getPreciseDateElement( new Date() ) ).getValueAsString() ); }
@Test public void getPreciseDateElementLocalDate() { Assert.assertEquals( new DateType( new Date() ).getValueAsString(), Objects.requireNonNull( utils.getPreciseDateElement( LocalDate.now() ) ).getValueAsString() ); }
@Test public void getPreciseDateElementNull() { Assert.assertNull( utils.getPreciseDateElement( null ) ); }