### Question:
Dstu3GeoDhisToFhirTransformerUtils extends AbstractGeoDhisToFhirTransformerUtils { @Override public void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ) throws TransformerException { final Element e = (Element) element; e.getExtension().removeIf( i -> GEO_LOCATION_URI.equals( i.getUrl() ) ); if ( location != null ) { e.addExtension().setUrl( GEO_LOCATION_URI ) .addExtension( new Extension().setUrl( LATITUDE_URL ) .setValue( new DecimalType( location.getLatitude() ) ) ) .addExtension( new Extension().setUrl( LONGITUDE_URL ) .setValue( new DecimalType( location.getLongitude() ) ) ); } } Dstu3GeoDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ); @Nullable @Override IBaseBackboneElement createPosition( @Nullable Location location );  }### Answer:
@Test public void updateAddressLocationNull() { final Address address = new Address(); utils.updateAddressLocation( address, null ); Assert.assertEquals( 0, address.getExtensionsByUrl( "http: }
@Test public void updateAddressLocationRemoved() { final Address address = new Address(); address.addExtension().setUrl( "http: utils.updateAddressLocation( address, null ); Assert.assertEquals( 0, address.getExtensionsByUrl( "http: }
@Test public void updateAddressLocationAddress() { final Address address = new Address(); final Location location = new Location( 47.1, -23.2 ); utils.updateAddressLocation( address, location ); Assert.assertEquals( 1, address.getExtensionsByUrl( "http: Assert.assertEquals( 1, address.getExtensionsByUrl( "http: .getExtensionsByUrl( "longitude" ).size() ); Assert.assertEquals( BigDecimal.valueOf( 47.1 ), ( (DecimalType) address.getExtensionsByUrl( "http: .getExtensionsByUrl( "longitude" ).get( 0 ).getValue() ).getValueAsNumber() ); Assert.assertEquals( 1, address.getExtensionsByUrl( "http: .getExtensionsByUrl( "latitude" ).size() ); Assert.assertEquals( BigDecimal.valueOf( -23.2 ), ( (DecimalType) address.getExtensionsByUrl( "http: .getExtensionsByUrl( "latitude" ).get( 0 ).getValue() ).getValueAsNumber() ); }