JAL-2210 refactor code to remove from a list of dbrefs those which match primary...