Prior to the Code, the incompetency of a residuary legatee in behalf of personal representatives, was undisputed (7 Cow. 64, Campbell vs. Tousey). He had a direct interest to sustain or defeat a recovery, because affecting the residuum of the estate in which he was a participant. But we think the referee erred in applying the former rigid common law rule to a case like the present under the Code, or in'holding that a residuary legatee of a solvent estate was immediately interested, and therefore incompetent as a witness.
Under the Code no interest disqualifies, except as applied to a party to the action, or to a person for whose immediate benefit *444the action is prosecuted or defended (§ 398, 399). When not a party, the latter section applies to a person, standing in close legal relationship—•-in pari materia—to the party to the action, and for whom the party would hold the fruits of the judgment as trustee. For instance a cestui que trust or ward, when the trustee or guardian prosecutes or defends.
It may be stated as a safe rule, to regard those only as immediately benefitted, who, though not named as parties, may nevertheless be examined as such, by the party adverse in interest, under section 396. A residuary legatee certainly could not be called to the stand under this section. He has a clear interest in the question and in the event of the suit, but it is remote and future; with more propriety it may be said that his interest is rather in the ultimate" effects of the judgment in the action, than in the action itself.
It was the intent of the legislature to change, radically, the law of evidence as to the competency of witnesses; to discard the common law test of a pecuniary interest in the event of the suit, and to exclude only parties to the record, and those who are quasi parties by reason of an immediate beneficial interest. This is obvious from the use of the term “ immediate benefit ” as distinguished from a resulting or collateral interest in the event.
If a legatee interested in the residuum of an estate is incompetent under the Code, then almost every conceivable interest in the result of the controversy would disqualify. His interest is no more certain or immediate than that of a creditor of an insolvent intestate’s estate, in behalf of an administrator (4 Denio, 88, Flinn vs. Chase). But it would not be contended that such creditor is incompetent under the Code. He has" no immediate interest in the sense of the Code, but he has a clear and fixed interest in protecting the fund from which he" is to receive a"distributive- share. His relation to the distributive fund is precisely analogous- to that of a legatee to the residuum, and both are competent witnesses under the present law.
The referee, wre think, erred in this case in rejecting the re'siduary legatee as a witness in behalf of the personal representative of the deceased, and that a new trial must be granted, with costs to abide the event