### Question:
Dstu3HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Override @Nullable public String getFirstGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().findFirst().map( PrimitiveType::getValue ).orElse( null ); } Dstu3HumanNameFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull Dstu3DateTimeFhirToDhisTransformerUtils dateTimeTransformerUtils ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override @Nullable String getSingleGiven( @Nullable ICompositeType humanName ); @Override @Nullable String getFirstGiven( @Nullable ICompositeType humanName ); @Nullable @Override String getSecondGiven( @Nullable ICompositeType humanName ); @Override @Nullable HumanName getPrimaryName( @Nonnull List<? extends ICompositeType> names );  }### Answer:
@Test public void firstGiven() { final HumanName humanName = new HumanName().addGiven( "Peter" ).addGiven( "Francis" ).addGiven( "Alice" ).setFamily( "Lobster" ); Assert.assertEquals( "Peter", utils.getFirstGiven( humanName ) ); }
@Test public void noFirstGiven() { final HumanName humanName = new HumanName().setFamily( "Lobster" ); Assert.assertNull( utils.getFirstGiven( humanName ) ); }