(a) Distributees and testamentary beneficiaries are liable, as provided in 12-1.1, in the following order:
(1) Distributees.
(2) Residuary beneficiaries.
(3) General beneficiaries. Demonstrative beneficiaries shall be treated as general beneficiaries, to the extent that the property or fund charged with a demonstrative disposition has adeemed.
(4) Specific beneficiaries. Demonstrative beneficiaries shall be treated as specific beneficiaries if the property or fund charged with any demonstrative disposition has not adeemed, to the extent of the value of such property or fund.
(5) A surviving spouse to whom a disposition has been made which qualifies for the estate tax marital deduction.
(b) The order of liability provided in paragraph (a) shall not apply to the liability for an estate or other death tax, under the law of this state or of any other jurisdiction, with respect to any property required to be included in the gross tax estate of a decedent under the provisions of any such law. The apportionment of such estate or other death tax, and the liability, under 12-1.1, of distributees and testamentary beneficiaries consequent to such apportionment are governed by the provisions of 2-1.8.
(c) The express or implied intention of the testator to prefer certain beneficiaries shall be effective to vary the order of liability prescribed by paragraph (a).
(d) If, in an action under this article, it is established to the satisfaction of the court that:
(1) The defendant is liable for the payment of two or more claims, preference in the payment of such claims must be given in the order prescribed by law for payment of the debts of the decedent and the obligations of his estate.
(2) An unsatisfied claim exists which is legally preferred to that of the plaintiff, the existence of such unsatisfied claim is a defense to the action if the aggregate value of the decedent's property passing to defendant and other persons in his order of liability does not exceed the amount of such unsatisfied claim; if in excess of the amount of such unsatisfied claim, the plaintiff may recover such ratable share of the excess as the amount of his claim bears to the claims of all persons in the same order of preference as his.