When a beneficiary under a will receives their inheritance prior to the testator's death, the question then becomes whether or not the devise is satisfied. This is known as ademption by satisfaction.
For reference, ademption is defined as property that was listed in the person's will that is not in his or her estate at the time of their death. Black's Law Dictionary 8th ed. (West Group, 2004). Of note, when I was in law school, the term used for ademption by satisfaction was "advancement." Other jurisdictions may use the latter term instead of the former.
California Probate Code § 21135 states that if one of the following conditions occurs, then ademption by satisfaction is triggered:
(a) Property given by a transferor during his or her lifetime to a person is treated as a satisfaction of an at-death transfer to that person in whole or in part only if one of the following conditions is satisfied:
(1) The instrument provides for deduction of the lifetime gift from the at-death transfer.
(2) The transferor declares in a contemporaneous writing that the gift is in satisfaction of the at-death transfer or that its value is to be deducted from the value of the at-death transfer.
(3) The transferee acknowledges in writing that the gift is in satisfaction of the at-death transfer or that its value is to be deducted from the value of the at-death transfer.
(4) The property given is the same property that is the subject of a specific gift to that person.
For example, Thomas Hobbs, a widower without any children, wrote a will that included a gift of $25,000 to his neighbor Bobby Winghart. The balance of his estate went to his friend, a famous author, Samuel Langhorne Clemens. Thomas named his uncle Elvis Hobbs as executor.