As far as I know it is dependent on the will & testament of the deceased, unless contested.
The case I was thining of (the gay guys) is a guy wh's partner died and as far as I can recall he was nmed as beneficiary, but now the deceased guy's family disputes any relationship between the two...