Pager<SpecimenOrObservationBase> existingSpecimens = cdmAppController.getOccurrenceService().findByTitle(config);
if(!existingSpecimens.getRecords().isEmpty()){
if(existingSpecimens.getRecords().size()==1){
return existingSpecimens.getRecords().iterator().next();
}
}
Pager<SpecimenOrObservationBase> existingSpecimens = cdmAppController.getOccurrenceService().findByTitle(config);
if(!existingSpecimens.getRecords().isEmpty()){
if(existingSpecimens.getRecords().size()==1){
return existingSpecimens.getRecords().iterator().next();
}
}