Program: 23767
Project: 23767
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent convertConformanceRestComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent();
  copyElement(src,tgt);
  tgt.setMode(convertRestfulConformanceMode(src.getMode()));
  tgt.setDocumentation(src.getDocumentation());
  tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity()));
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceComponent t : src.getResource())   tgt.addResource(convertConformanceRestResourceComponent(t));
  boolean batch=false;
  boolean transaction=false;
  for (  org.hl7.fhir.dstu3.model.Conformance.SystemInteractionComponent t : src.getInteraction()) {
    if (t.getCode().equals(SystemRestfulInteraction.BATCH))     batch=true;
 else     tgt.addInteraction(convertSystemInteractionComponent(t));
    if (t.getCode().equals(SystemRestfulInteraction.TRANSACTION))     transaction=true;
  }
  if (batch)   tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH);
 else   tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.TRANSACTION : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.NOTSUPPORTED);
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam())   tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t));
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestOperationComponent t : src.getOperation())   tgt.addOperation(convertConformanceRestOperationComponent(t));
  for (  org.hl7.fhir.dstu3.model.UriType t : src.getCompartment())   tgt.addCompartment(t.getValue());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent convertConformanceRestComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent();
  copyElement(src,tgt);
  tgt.setMode(convertRestfulConformanceMode(src.getMode()));
  tgt.setDocumentation(src.getDocumentation());
  tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity()));
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceComponent t : src.getResource())   tgt.addResource(convertConformanceRestResourceComponent(t));
  boolean batch=false;
  boolean transaction=false;
  for (  org.hl7.fhir.dstu3.model.Conformance.SystemInteractionComponent t : src.getInteraction()) {
    if (t.getCode().equals(SystemRestfulInteraction.BATCH))     batch=true;
 else     tgt.addInteraction(convertSystemInteractionComponent(t));
    if (t.getCode().equals(SystemRestfulInteraction.TRANSACTION))     transaction=true;
  }
  if (batch)   tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH);
 else   tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.TRANSACTION : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.NOTSUPPORTED);
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam())   tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t));
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestOperationComponent t : src.getOperation())   tgt.addOperation(convertConformanceRestOperationComponent(t));
  for (  org.hl7.fhir.dstu3.model.UriType t : src.getCompartment())   tgt.addCompartment(t.getValue());
  return tgt;
}