Program: 23595
Project: 23595
Buggy source:
public org.hl7.fhir.dstu2.model.TestScript convertTestScript(org.hl7.fhir.dstu3.model.TestScript src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.TestScript tgt=new org.hl7.fhir.dstu2.model.TestScript();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setVersion(src.getVersion());
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setExperimental(src.getExperimental());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptContactComponent t : src.getContact())   tgt.addContact(convertTestScriptContactComponent(t));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCopyright(src.getCopyright());
  tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture())   tgt.addFixture(convertTestScriptFixtureComponent(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getProfile())   tgt.addProfile(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable())   tgt.addVariable(convertTestScriptVariableComponent(t));
  tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest())   tgt.addTest(convertTestScriptTestComponent(t));
  tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.TestScript convertTestScript(org.hl7.fhir.dstu3.model.TestScript src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.TestScript tgt=new org.hl7.fhir.dstu2.model.TestScript();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setVersion(src.getVersion());
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setExperimental(src.getExperimental());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptContactComponent t : src.getContact())   tgt.addContact(convertTestScriptContactComponent(t));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCopyright(src.getCopyright());
  tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture())   tgt.addFixture(convertTestScriptFixtureComponent(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getProfile())   tgt.addProfile(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable())   tgt.addVariable(convertTestScriptVariableComponent(t));
  tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest())   tgt.addTest(convertTestScriptTestComponent(t));
  tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
  return tgt;
}