### Question:
R4AddressFhirToDhisTransformerUtils extends AbstractAddressFhirToDhisTransformerUtils { @Nullable @Override public String getConstructedText( @Nullable ICompositeType address, @Nonnull String delimiter ) { final Address convertedAddress = (Address) address; if ( address == null ) { return null; } final StringBuilder sb = new StringBuilder(); convertedAddress.getLine().stream().filter( l -> (l != null) && StringUtils.isNotBlank( l.getValue() ) ) .forEach( l -> sb.append( delimiter ).append( l.getValue() ) ); if ( StringUtils.isNotBlank( convertedAddress.getPostalCode() ) && StringUtils.isNotBlank( convertedAddress.getCity() ) ) { sb.append( delimiter ).append( convertedAddress.getPostalCode() ).append( ' ' ).append( convertedAddress.getCity() ); } else if ( StringUtils.isNotBlank( convertedAddress.getPostalCode() ) ) { sb.append( delimiter ).append( convertedAddress.getPostalCode() ); } else if ( StringUtils.isNotBlank( convertedAddress.getCity() ) ) { sb.append( delimiter ).append( convertedAddress.getCity() ); } if ( StringUtils.isNotBlank( convertedAddress.getState() ) ) { sb.append( delimiter ).append( convertedAddress.getState() ); } if ( sb.length() == 0 ) { return convertedAddress.getText(); } return sb.substring( delimiter.length() ); } R4AddressFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull R4DateTimeFhirToDhisTransformerUtils dateTimeTransformerUtils ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Nullable @Override ICompositeType getPrimaryAddress( @Nonnull List<? extends ICompositeType> addresses ); @Nullable @Override String getSingleLine( @Nullable ICompositeType address, @Nonnull String delimiter ); @Nullable @Override String getConstructedText( @Nullable ICompositeType address, @Nonnull String delimiter ); @Nullable @Override String getText( @Nullable ICompositeType address );  }### Answer:
@Test public void getConstructedText() { final Address address = new Address().addLine( "Lower Road 20" ).addLine( "Apartment 19" ) .setCity( "Freetown" ).setPostalCode( "2009" ).setState( "Other State" ).setCountry( "Sierra Leone" ); Assert.assertEquals( "Lower Road 20 / Apartment 19 / 2009 Freetown / Other State", utils.getConstructedText( address ) ); }
@Test public void getConstructedTextWithoutPostcode() { final Address address = new Address().addLine( "Lower Road 20" ).addLine( "Apartment 19" ) .setCity( "Freetown" ).setState( "Other State" ).setCountry( "Sierra Leone" ); Assert.assertEquals( "Lower Road 20 / Apartment 19 / Freetown / Other State", utils.getConstructedText( address ) ); }