}else if(rts.size() == 1){
setAllReferents(rts.toArray(new ReferenceTarget[0])[0], entities);
}else{
if(mergeReferents){
ReferenceTarget rt = createReferenceTarget(jCas);
<BUG>setReferents(rt, JCasUtil.select(jCas, Entity.class), rts);
removeFromJCasIndex(rts);</BUG>
}else{
getMonitor().warn("Multiple existing referents found, only those entities without existing referents will be modified");
setNewReferentIfNull(jCas, entities);

}else if(rts.size() == 1){
setAllReferents(rts.toArray(new ReferenceTarget[0])[0], entities);
}else{
if(mergeReferents){
ReferenceTarget rt = createReferenceTarget(jCas);
setReferents(rt, entities, rts);
removeFromJCasIndex(rts);
}else{
getMonitor().warn("Multiple existing referents found, only those entities without existing referents will be modified");
setNewReferentIfNull(jCas, entities);
