### Question:
R4PatientFhirToDhisTransformerUtils extends AbstractPatientFhirToDhisTransformerUtils { @Nullable @Override public ICompositeType getBirthPlaceAddress( @Nullable IDomainResource patient ) { if ( patient == null ) { return null; } final Patient p = (Patient) patient; final List<Extension> birthPlaceExtensions = p.getExtensionsByUrl( BIRTH_PLACE_URI ); if ( birthPlaceExtensions.isEmpty() ) { return null; } if ( birthPlaceExtensions.size() > 1 ) { throw new TransformerMappingException( "Patient contains " + birthPlaceExtensions.size() + " birth places." ); } final Type value = birthPlaceExtensions.get( 0 ).getValue(); if ( (value == null) || value.isEmpty() ) { return null; } if ( !(value instanceof Address) ) { throw new TransformerMappingException( "Patient contains birth place that is no address: " + value.fhirType() ); } return (Address) value; } R4PatientFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Nullable @Override ICompositeType getBirthPlaceAddress( @Nullable IDomainResource patient );  }### Answer:
@Test public void nullPatient() { Assert.assertNull( utils.getBirthPlaceAddress( null ) ); }
@Test public void validAddress() { final Address address = new Address().setText( "Hospital" ); final Patient patient = new Patient(); patient.addExtension().setUrl( "http: Assert.assertSame( address, utils.getBirthPlaceAddress( patient ) ); }