
318 B.R. 729 (2004)
In re James F. GEORGE III and Margie R. George, Debtors.
James F. George III; Margie R. George, Appellants,
v.
City of Morro Bay, Appellee.
BAP No. CC-04-1319-KPAB, Bankruptcy No. ND 94-12409 RR, Adversary No. ND 02-01228 RR.
United States Bankruptcy Appellate Panel of the Ninth Circuit.
Argued and Submitted November 17, 2004.
Filed December 9, 2004.
*730 *731 James F. George, III and Margie R. George, Atascadero, CA, Pro se Appellants.
Peter E. Cummings, Hunt & Associates, Paso Robles, CA, for City of Morro Bay.
Before: KLEIN, PAPPAS[*] and BRANDT, Bankruptcy Judges.

OPINION
KLEIN, Bankruptcy Judge.
This is an appeal from a judgment based on the res judicata doctrine of claim preclusion, which the court invoked to refuse to consider a new theory regarding a transaction that the parties previously had litigated to finality. Concluding that the General Rule of Bar and the General Rule Concerning Splitting, as stated in Restatement (Second) of Judgments §§ 19 and 24, combine to warrant imposition of claim preclusion, we AFFIRM.

FACTS
Appellants, James and Margie George, who in 1987 had leased nonresidential real property for thirty years from appellee, the City of Morro Bay, filed a chapter 11 case (later converted to chapter 7) in June 1994.
*732 The Georges and the City went to war with each other in September 1994, when the City made a motion for surrender of the leasehold premises pursuant to 11 U.S.C. § 365(d)(4), sixty days having elapsed without a motion to assume or reject the lease.
The Georges belatedly sought to assume the lease, contending that the City had waived its § 365(d)(4) rights when it accepted rent post-petition.
The bankruptcy court ruled that the City was entitled to return of the premises regardless of whether rent was current.
Since then, convinced they were cheated out of their thirty-year lease, the Georges have waged the war on multiple fronts.
The Georges' campaign to retain possession of the premises lasted until the U.S. Supreme Court denied certiorari in 2000. The details were chronicled by the Ninth Circuit in George v. City of Morro Bay (In re George), 177 F.3d 885, 886-87 (9th Cir.1999), cert. denied, 528 U.S. 1135, 120 S.Ct. 978, 145 L.Ed.2d 929 (2000)("George I").
Meanwhile, the Georges counterattacked on a second front in March 1996, commencing an adversary proceeding for affirmative relief against the City and others, including the bank that took over the lease. The complaint alleged sixteen federal and state counts arising from the leasehold dispute, including theories under 42 U.S.C. § 1983, the Fifth Amendment, and RICO.
After seven years of convoluted skirmishing, the affirmative relief campaign ended with all federal counts dismissed with prejudice and the state counts dismissed without prejudice. The details appear in George v. City of Morro Bay (In re George), 322 F.3d 586, 588-91 (9th Cir.2003) ("George II").[1]
In November 2002, the anti-discrimination provision of 11 U.S.C. § 525 came to the Georges' attention.[2] They filed a complaint seeking a declaration that "termination of the Plaintiffs' lease was void and a violation of" § 525, together with "such other relief as is proper and just."
The City's answer asserted various affirmative defenses, including statute of limitations, "res judicata" (claim preclusion), and "collateral estoppel" (issue preclusion).
At the time of trial, the bankruptcy court ruled that the complaint was time-barred and barred by rules of res judicata.
After unsuccessful post-trial motions, this appeal ensued.

JURISDICTION
The bankruptcy court had jurisdiction via 28 U.S.C. §§ 1334 and 157(b)(1). We have jurisdiction under 28 U.S.C. § 158(a)(1).

ISSUE
Whether the "General Rule of Bar" and the "General Rule Concerning Splitting" justified imposing claim preclusion to reject a new legal theory based on previously-litigated facts.

STANDARD OF REVIEW
We review rulings regarding the availability of res judicata doctrines, including claim preclusion, de novo as mixed *733 questions of law and fact in which legal questions predominate. Robi v. Five Platters, Inc., 838 F.2d 318, 321 (9th Cir.1988); Alary Corp. v. Sims (In re Assoc'd Vintage Group, Inc.), 283 B.R. 549, 554 (9th Cir. BAP 2002). Once we determine that the doctrines are available to be applied, the actual decision to apply them is left to the trial court's discretion. Robi, 838 F.2d at 321.

DISCUSSION
This appeal turns on whether either of two bankruptcy court judgments trigger the res judicata doctrines of claim and issue preclusion, which apply in bankruptcy. Brown v. Felsen, 442 U.S. 127, 134-39, 99 S.Ct. 2205, 60 L.Ed.2d 767 (1979); Paine v. Griffin (In re Paine), 283 B.R. 33, 39 (9th Cir. BAP 2002); Alary Corp., 283 B.R. at 554-55.
The res judicata doctrines regarding judgments of federal courts are a matter of federal common law. W. Sys., Inc. v. Ulloa, 958 F.2d 864, 871 (9th Cir.1992); Robi, 838 F.2d at 322.
The Supreme Court treats the Restatement (Second) of Judgments ("Restatement") as an authoritative statement of federal res judicata doctrines and has applied the Restatement's substitution of the terms "claim preclusion" and "issue preclusion" for "res judicata" and "collateral estoppel." E.g., New Hampshire v. Maine, 532 U.S. 742, 748, 121 S.Ct. 1808, 149 L.Ed.2d 968 (2001) ("res judicata doctrines commonly termed claim and issue preclusion"); Baker v. Gen. Motors Corp., 522 U.S. 222, 233 n. 5, 118 S.Ct. 657, 139 L.Ed.2d 580 (1998); Migra v. Warren City Sch. Dist. Bd. of Educ., 465 U.S. 75, 77 n. 1, 104 S.Ct. 892, 79 L.Ed.2d 56 (1984); Hiser v. Franklin, 94 F.3d 1287, 1290 (9th Cir.1996); Robi, 838 F.2d at 321-22; 18 CHARLES A. WRIGHT, ARTHUR R. MILLER & Edward H. Cooper, Federal Practice & Procedure § 4402 (2d ed.2003).

I
Issue preclusion bars relitigation only of issues that have been actually litigated, while the broader brush of claim preclusion may also bar a cause of action that never has been litigated. Alary Corp., 283 B.R. at 555. Since there has been no actual litigation of the § 525 theory, this is purely a case of intramural (i.e. within the federal courts[3]) claim preclusion.
The Georges litigated the question of validity of the premises surrender to finality. They also separately litigated to finality an amalgam of theories for affirmative relief arising out of the circumstances of the premises surrender dispute.
In each instance, finality occurred when the bankruptcy court entered judgment disposing of all claims. Fed.R.Civ.P. 54(b), incorporated by Fed. R. Bankr.P. 7054 & 9014; United States ex rel. Barajas v. Northrop Corp., 147 F.3d 905, 909 (9th Cir.1998) ("Barajas"); RESTATEMENT (SECOND) OF JUDGMENTS § 14 (1980).[4]
*734 Although the pendency of appeals did not affect finality, the ultimate affirmances in George I and George II added a dimension to the finality of the bankruptcy court's judgments.
After the litigations regarding premises surrender and affirmative relief were final, the Georges discovered the anti-discrimination provision of Bankruptcy Code § 525(a) and commenced a new adversary proceeding seeking § 525 relief.
The City's answer to the § 525 complaint pleaded a number of affirmative defenses, including (using the obsolete terms res judicata and collateral estoppel) claim and issue preclusion. The court relied on preclusion as a basis for denying relief.
We need not delve into the vagaries of § 525, except to note that § 525 has been the basis for affirmative relief that might pertain if the Georges' cause had merit. See 4 COLLIER ON BANKRUPTCY (ALAN RESNICK & HENRY SOMMER EDS.) ¶ 525.06 (15th ed. rev.2003).
What matters is that, assuming (without deciding) the new theory had factual and legal merit and could trump § 365(d)(4), the § 525 issue could have been asserted defensively in the premises surrender litigation and could have been asserted offensively as an additional theory in the affirmative relief litigation, both of which resulted in valid and final judgments.

II
Claim preclusion is the consequence of applying the General Rules of Merger and of Bar and the General Rule Concerning Splitting (and their exceptions) to a valid and final personal judgment. RESTATEMENT (SECOND) OF JUDGMENTS § 17.[5]
The General Rule of Merger contemplates that a judgment in favor of a plaintiff extinguishes the entire claim, which merges into the judgment. Future actions may be maintained "on the judgment." California v. Taxel (In re Del Mission Ltd.), 98 F.3d 1147, 1150-51 (9th Cir.1996); RESTATEMENT (SECOND) OF JUDGMENTS § 18.[6]
*735 Under the General Rule of Bar, a judgment in favor of a defendant ordinarily bars the plaintiff from maintaining another action on the same claim. Gilbert v. Ben-Asher, 900 F.2d 1407, 1410-11 (9th Cir.1990); RESTATEMENT (SECOND) OF JUDGMENTS §§ 19-20.[7]
What is barred by claim preclusion is another action on the same "claim," which is a Restatement term of art with a different meaning than the bankruptcy concept of a "claim." Compare RESTATEMENT (SECOND) OF JUDGMENTS § 24 ("Dimensions of `Claim'"), with 11 U.S.C. § 101(5) (defining "claim").
What constitutes the same "claim" for purposes of claim preclusion is determined under the so-called "transactional test" in the General Rule Concerning Splitting. This test focuses on the transactional nucleus of operative facts and includes all rights to remedies with respect to all or any part of the "transaction," determined pragmatically, out of which the action arose, so long as they could conveniently be tried together. W. Sys., Inc., 958 F.2d at 871; RESTATEMENT (SECOND) OF JUDGMENTS § 24.[8]
Legal theories and remedies not asserted are extinguished. Lindsay v. Beneficial Reins. Co. (In re Lindsay), 59 F.3d 942, 952 (9th Cir.1995); RESTATEMENT *736 (SECOND) OF JUDGMENTS § 25.[9]
The listed exceptions to the General Rule Concerning Splitting, however, import a measure of latitude as to where to draw the pragmatic line. These include an agreement of the parties to split a claim, express authorization of splitting by court in the first action, and limitations on court's authority or jurisdiction in the first action to entertain the full claim. California v. Randtron, 284 F.3d 969, 975 (9th Cir.2002); Barajas, 147 F.3d at 911; R ESTATEMENT (SECOND) OF JUDGMENTS § 26.[10]
Finally, the res judicata doctrines are neither mandatory, nor jurisdictional. Claim and issue preclusion must be raised affirmatively and, if not raised, may be treated as waived. Thus, a second judgment trumps an earlier inconsistent judgment. Robi, 838 F.2d at 327-28; Americana Fabrics, Inc. v. L & L Textiles, Inc., 754 F.2d 1524, 1529-30 (9th Cir.1985); RESTATEMENT (SECOND) OF JUDGMENTS § 15.[11] When asserted defensively, preclusion must be pled as an affirmative defense. Fed.R.Civ.P. 8(c).
*737 As an affirmative matter, the proponent of preclusion has both the burden of persuasion and the correlative risk of non-persuasion. Educ. Credit Mgmt. Corp. v. Repp (In re Repp), 307 B.R. 144, 148 n. 3 (9th Cir. BAP 2004).

III
Applying claim preclusion rules to this case requires consideration of the premises surrender litigation against the Georges and of the affirmative relief litigation they prosecuted.

A
In the premises surrender litigation, the City, as movant, was in the role of plaintiff, obtaining a judgment in its favor.
Although the Georges' newfound § 525 theory arguably could have been asserted as a defense to the City's motion to compel surrender of the premises, several reasons militate against basing claim preclusion on such an omission.[12]
First, although a defendant, in an action on an earlier judgment, cannot rely on defenses that might have been interposed in the first action, the present matter does not involve an action on the City's premises surrender judgment. RESTATEMENT (SECOND) OF JUDGMENTS § 18(2). Rather, it is a separate action by the defendants, who are not now asserting the matter defensively.
Nor does the failure to have asserted the § 525 theory as a counterclaim in the premises surrender litigation justify preclusion. Int'l Ambassador Programs, Inc. v. Archexpo, 68 F.3d 337, 340-41 (9th Cir.1995); R ESTATEMENT (SECOND) OF JUDGMENTS § 22.[13]
The issues are not mirror images. The matter of surrender of premises, which was the issue in the contested matter, is conceptually distinct from the question of the integrity of lease termination that is the focus of the § 525 theory.
That litigation was brought as a "contested matter" governed by Federal Rule of Bankruptcy Procedure 9014, which makes many of the adversary proceeding rules applicable in contested matters, but not the counterclaim rules. Compare Fed. R. Bankr.P. 7013, incorporating Fed.R.Civ.P. 13, with Fed. R. Bankr.P. 9014.
Since an attempt to assert the § 525 theory as a counterclaim in the premises surrender litigation would have been procedurally out of order, Restatement § 22 does not apply. The precondition that the defendant "may" interpose the counterclaim is not satisfied. RESTATEMENT (SECOND) OF JUDGMENTS § 22(1).
Similarly, the restriction on counterclaims in Rule 9014 contested matters would also implicate two of the exceptions *738 to the General Rule Concerning Splitting: (1) restriction on the court's authority to entertain the counterclaim; and (2) the sense of the statutory rules scheme that the claim be permitted to be split. RESTATEMENT (SECOND) OF JUDGMENTS § 26(1)(c)-(d).
Thus, the Georges' omission to have raised the § 525 theory in the premises surrender litigation does not support preclusion.

B
The Georges' omission of the § 525 theory from their affirmative relief litigation against the City, which asserted sixteen federal and state counts, and which ended with judgment in favor of the City and all federal counts dismissed with prejudice, is another matter.
Under the General Rule of Bar, the valid and final judgment in favor of the City bars another action by the Georges on the same "claim." RESTATEMENT (SECOND) OF JUDGMENTS § 19.
Since all federal counts were dismissed with prejudice, no exception to the General Rule of Bar applies. RESTATEMENT (SECOND) OF JUDGMENTS § 20.
The dispositive question, then, is whether the § 525 theory was part of the "claim" that was extinguished when the federal counts were dismissed with prejudice. That requires applying the transactional test made applicable by the General Rule Concerning Splitting. RESTATEMENT (SECOND) OF JUDGMENTS § 24.
The bankruptcy court ruled that the newfound § 525 theory arose out of the same nucleus of facts as the prior action.[14] We agree. The operative facts are identical; the § 525 theory formed a convenient trial unit with the other federal counts in the adversary proceeding; and the expectations created by the rules of procedure all support the conclusion that the facts supporting the § 525 theory are, under the General Rule Concerning Splitting, part of the same "transaction" that was previously litigated and, hence, part of the same "claim" for purposes of the General Rule of Bar.
This analysis is confirmed by the fact that a new theory of the case is listed in the Restatement as a paradigm example of what is extinguished under the doctrine of claim preclusion. RESTATEMENT (SECOND) OF JUDGMENTS § 25(1).
In short, the Georges' newfound § 525 theory is part of the "claim" that was extinguished under the General Rule of Bar, as determined by applying the transactional test prescribed by the General Rule Concerning Splitting.[15] Hence, claim preclusion was available to be imposed; we cannot say that the bankruptcy court abused its discretion in doing so.

CONCLUSION
The bankruptcy court correctly ruled that claim preclusion was available as a *739 defense and did not abuse its discretion in applying it and dismissing the adversary proceeding. AFFIRMED.
NOTES
[*]  Hon. Jim D. Pappas, Bankruptcy Judge for the District of Idaho, sitting by designation.
[1]  Besides George I and George II, there are two unpublished Ninth Circuit decisions: 1999 WL 387070 & 1999 WL 387082 (9th Cir.1999).
[2]  11 U.S.C. § 525(a) provides, in part: . . . a governmental unit may not deny, revoke, suspend, or refuse to renew a license, permit, charter, franchise, or other similar grant to . . . a person . . . solely because such [person is] a debtor under this title . . .

11 U.S.C. § 525(a).
[3]  All federal judgments, for conflict of law purposes, are treated as if they were the judgments of the courts of one state. Robi, 838 F.2d at 322. The Restatement explains:

This Section, like the whole of the present Restatement, is concerned mainly with the res judicata effects of a judgment upon later actions in the courts of the same state. Effects in the courts of a sister state are dealt with in Restatement, Second, Conflict of Laws §§ 93-121. Attention is invited particularly to the discussion of the problem of merger in interstate situations, summarized herein at § 18, Comment d.
RESTATEMENT (SECOND) OF JUDGMENTS § 17, footnote 1.
[4]  Finality is determined as follows:

§ 14. Effective Date of Final Judgment
For purposes of res judicata, the effective date of a final judgment is the date of its rendition, without regard to the date of commencement of the action in which it is rendered or the action in which it is to be given effect.
RESTATEMENT (SECOND) OF JUDGMENTS § 14.
[5]  The foundational rule is:

§ 17. Effects of Former Adjudication  General Rules
A valid and final personal judgment is conclusive between the parties, except on appeal or other direct review, to the following extent:
(1) If the judgment is in favor of the plaintiff, the claim is extinguished and merged in the judgment and a new claim may arise on the judgment (see § 18);
(2) If the judgment is in favor of the defendant, the claim is extinguished and the judgment bars a subsequent action on that claim (see § 19);
(3) A judgment in favor of either the plaintiff or the defendant is conclusive, in a subsequent action between them on the same or a different claim, with respect to any issue actually litigated and determined if its determination was essential to that judgment (see § 27).
These general rules are subject to exceptions: as to Subsections (1) and (2), see §§ 20 and 26; as to Subsection (3), see § 28. [Cross-reference to Restatement (Second), Conflict of Laws omitted.]
RESTATEMENT (SECOND) OF JUDGMENTS § 17.
[6]  The General Rule of Merger is:

§ 18. Judgment for Plaintiff  The General Rule of Merger
When a valid and final personal judgment is rendered in favor of the plaintiff:
(1) The plaintiff cannot thereafter maintain an action on the original claim or any part thereof, although he may be able to maintain an action upon the judgment; and
(2) In an action upon the judgment, the defendant cannot avail himself of defenses he might have interposed, or did interpose, in the first action.
RESTATEMENT (SECOND) OF JUDGMENTS § 18.
[7]  The General Rule of Bar is

§ 19. Judgment for Defendant  The General Rule of Bar
A valid and final personal judgment rendered in favor of the defendant bars another action by the plaintiff on the same claim.
RESTATEMENT (SECOND) OF JUDGMENTS § 19.
The exceptions to the General Rule of Bar are:
§ 20. Judgment for Defendant  Exceptions to the General Rule of Bar
(1) A personal judgment for the defendant, although valid and final, does not bar another action by the plaintiff on the same claim:
(a) When the judgment is one of dismissal for lack of jurisdiction, for improper venue, or for nonjoinder or misjoinder of parties; or
(b) When the plaintiff agrees to or elects a nonsuit (or voluntary dismissal) without prejudice or the court directs that the plaintiff be nonsuited (or that the action be otherwise dismissed) without prejudice; or
(c) When by statute or rule of court the judgment does not operate as a bar to another action on the same claim, or does not so operate unless the court specifies, and no such specification is made.
(2) A valid and final personal judgment for the defendant, which rests on the prematurity of the action or on the plaintiff's failure to satisfy a precondition to suit, does not bar another action by the plaintiff instituted after the claim has matured, or the precondition has been satisfied, unless a second action is precluded by operation of the substantive law.
RESTATEMENT (SECOND) OF JUDGMENTS § 20.
[8]  The boundaries of a "claim" are established as follows:

§ 24. Dimensions of "Claim" for Purposes of Merger or Bar  General Rule Concerning "Splitting"
(1) When a valid and final judgment rendered in an action extinguishes the plaintiff's claim pursuant to the rules of merger or bar (see §§ 18, 19), the claim extinguished includes all rights of the plaintiff to remedies against the defendant with respect to all or any part of the transaction, or series of connected transactions, out of which the action arose.
(2) What factual grouping constitutes a "transaction", and what groupings constitute a "series", are to be determined pragmatically, giving weight to such considerations as whether the facts are related in time, space, origin, or motivation, whether they form a convenient trial unit, and whether their treatment as a unit conforms to the parties' expectations or business understanding or usage.
RESTATEMENT (SECOND) OF JUDGMENTS § 24.
[9]  This consequence follows from the exemplification:

§ 25. Exemplification of General Rule Concerning Splitting
The rule of § 24 applies to extinguish a claim by the plaintiff against the defendant even though the plaintiff is prepared in the second action
(1) To present evidence or grounds or theories of the case not presented in the first action, or
(2) To seek remedies or forms of relief not demanded in the first action.
RESTATEMENT (SECOND) OF JUDGMENTS § 25.
[10]  The specified exceptions are:

§ 26. Exceptions to the General Rule Concerning Splitting
(1) When any of the following circumstances exists, the general rule of § 24 does not apply to extinguish the claim, and part or all of the claim subsists as a possible basis for a second action by the plaintiff against the defendant:
(a) The parties have agreed in terms or in effect that the plaintiff may split his claim, or the defendant has acquiesced therein; or
(b) The court in the first action has expressly reserved the plaintiff's right to maintain the second action; or
(c) The plaintiff was unable to rely on a certain theory of the case or to seek a certain remedy or form of relief in the first action because of the limitations on the subject matter jurisdiction of the court or restrictions on their authority to entertain multiple theories or demands for multiple remedies or forms of relief in a single action, and the plaintiff desires in the second action to rely on that theory or to seek that remedy or form of relief; or
(d) The judgment in the first action was plainly inconsistent with the fair and equitable implementation of a statutory or constitutional scheme, or it is the sense of the scheme that the plaintiff should be permitted to split his claim; or
(e) For reasons of substantive policy in a case involving a continuing or recurrent wrong, the plaintiff is given an option to sue once for the total harm, both past and prospective, or to sue from time to time for the damages incurred to the date of suit, and chooses the latter course; or
(f) It is clearly and convincingly shown that the policies favoring preclusion of a second action are overcome for an extraordinary reason, such as the apparent invalidity of a continuing restraint or condition having a vital relation to personal liberty or the failure of the prior litigation to yield a coherent disposition of the controversy.
(2) In any case described in (f) of Subsection (1), the plaintiff is required to follow the procedure set forth in §§ 78-82.
RESTATEMENT (SECOND) OF JUDGMENTS § 26.
[11]  Waiver is implicit in the inconsistent judgment rule:

§ 15. Inconsistent Judgments
When in two actions inconsistent final judgments are rendered, it is the later, not the earlier, judgment that is accorded conclusive effect in a third action under the rules of res judicata.
RESTATEMENT (SECOND) OF JUDGMENTS § 15.
[12]  We intimate no view about whether § 525 actually constitutes a defense to surrender under § 365(d)(4).
[13]  The Restatement's counterclaim rule is:

§ 22. Effect of Failure to Interpose Counterclaim
(1) Where the defendant may interpose a claim as a counterclaim but he fails to do so, he is not thereby precluded from subsequently maintaining an action on that claim, except as stated in Subsection (2).
(2) A defendant who may interpose a claim as a counterclaim in an action but fails to do so is precluded, after the rendition of judgment in that action, from maintaining an action on the claim if:
(a) The counterclaim is required to be interposed by a compulsory counterclaim statute or rule of court, or
(b) The relationship between the counterclaim and the plaintiff's claim is such that successful prosecution of the second action would nullify the initial judgment or would impair rights established in the initial action.
RESTATEMENT (SECOND) OF JUDGMENTS § 22.
[14]  The court's pertinent findings were:

You're bringing a collateral attack on a prior determination, [not] only in this case  of this court, but the District Court, the [Bankruptcy] Appellate Panel, and the Ninth Circuit.
We have been through this lease rejection, lease termination, and property surrender in the motion brought originally by the City[, and] in the adversary proceeding that you filed against the City and others, and now another third proceeding.
This time you are bringing an action against the City for the very same set of circumstances. You're just trying a different legal theory. No.
Tr. of Proceedings, March 28, 2003, at p. 29.
[15]  Our conclusion makes it unnecessary to review the court's alternative ruling that the action was time barred.
