Program: 12727
Project: 12727
Buggy source:
private static MapsTo parseMapsTo(NestedDocument<QName> mappings){
  URI persistentIdentity=null;
  String displayId=null;
  String version=null;
  URI remote=null;
  RefinementType refinement=null;
  URI local=null;
  URI wasDerivedFrom=null;
  List<Annotation> annotations=new ArrayList<>();
  for (  NamedProperty<QName> m : mappings.getProperties()) {
    if (m.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      persistentIdentity=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else     if (m.getName().equals(Sbol2Terms.Documented.displayId)) {
      displayId=((Literal<QName>)m.getValue()).getValue().toString();
    }
 else     if (m.getName().equals(Sbol2Terms.Identified.version)) {
      version=((Literal<QName>)m.getValue()).getValue().toString();
    }
 else     if (m.getName().equals(Sbol2Terms.MapsTo.refinement)) {
      refinement=RefinementType.convertToRefinementType(URI.create(((Literal<QName>)m.getValue()).getValue().toString()));
    }
 else     if (m.getName().equals(Sbol2Terms.MapsTo.hasRemote)) {
      remote=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else     if (m.getName().equals(Sbol2Terms.MapsTo.hasLocal)) {
      local=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else     if (m.getName().equals(ProvTerms.Prov.wasDerivedFrom)) {
      wasDerivedFrom=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else {
      annotations.add(new Annotation(m));
    }
  }
  MapsTo map=new MapsTo(mappings.getIdentity(),refinement,local,remote);
  if (displayId != null)   map.setDisplayId(displayId);
  if (persistentIdentity != null)   map.setPersistentIdentity(persistentIdentity);
  if (version != null)   map.setVersion(version);
  if (wasDerivedFrom != null)   map.setWasDerivedFrom(wasDerivedFrom);
  if (!annotations.isEmpty())   map.setAnnotations(annotations);
  return map;
}

Fixed version (ground truth):
private static MapsTo parseMapsTo(NestedDocument<QName> mappings){
  URI persistentIdentity=null;
  String displayId=null;
  String version=null;
  URI remote=null;
  RefinementType refinement=null;
  URI local=null;
  URI wasDerivedFrom=null;
  List<Annotation> annotations=new ArrayList<>();
  for (  NamedProperty<QName> m : mappings.getProperties()) {
    if (m.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      persistentIdentity=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else     if (m.getName().equals(Sbol2Terms.Documented.displayId)) {
      displayId=((Literal<QName>)m.getValue()).getValue().toString();
    }
 else     if (m.getName().equals(Sbol2Terms.Identified.version)) {
      version=((Literal<QName>)m.getValue()).getValue().toString();
    }
 else     if (m.getName().equals(Sbol2Terms.MapsTo.refinement)) {
      refinement=RefinementType.convertToRefinementType(URI.create(((Literal<QName>)m.getValue()).getValue().toString()));
    }
 else     if (m.getName().equals(Sbol2Terms.MapsTo.hasRemote)) {
      remote=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else     if (m.getName().equals(Sbol2Terms.MapsTo.hasLocal)) {
      local=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else     if (m.getName().equals(Sbol2Terms.Identified.wasDerivedFrom)) {
      wasDerivedFrom=URI.create(((Literal<QName>)m.getValue()).getValue().toString());
    }
 else {
      annotations.add(new Annotation(m));
    }
  }
  MapsTo map=new MapsTo(mappings.getIdentity(),refinement,local,remote);
  if (displayId != null)   map.setDisplayId(displayId);
  if (persistentIdentity != null)   map.setPersistentIdentity(persistentIdentity);
  if (version != null)   map.setVersion(version);
  if (wasDerivedFrom != null)   map.setWasDerivedFrom(wasDerivedFrom);
  if (!annotations.isEmpty())   map.setAnnotations(annotations);
  return map;
}