OPINION *
Appellant Gelver Martinez appeals from orders of the District Court dismissing his complaint and denying his motion for reconsideration. We will affirm.
I.
This case concerns a mortgage on real property in Passaic, New Jersey, and related foreclosure proceedings. On appeal, we accept as true Martinez’s well-pleaded factual allegations. Baldwin v. Univ. of Pittsburgh Med. Ctr.,
According to Martinez, his mortgage was originated by First Residential Mortgage Services (“First Residential”), then was pooled with other loans, securitized and sold to a trust, for which Bank of America, N.A. (“BANA”), served as trustee. The promissory note secured by the mortgage was not deposited into the trust. Nationstar Mortgage (“Nationstar”), the loan servicer, did not timely notify Martinez of changes to certain characteristics of his mortgage. And Mortgage Electronic Registration Systems, Inc. (“MERS”), which served as nominee for First Residential, did not properly record the transfer of ownership interest in Martinez’s property from First Residential and MERS to the trust. Martinez believed the foregoing conduct rendered his mortgage unenforceable. 1
In 2014, Nationstar filed a foreclosure complaint in the Superior Court of New Jersey, Chancery Division (Passaic County). Nationstar alleged that Martinez was delinquent on his mortgage and, further, that it came into possession of the note and mortgage through two assignments: MERS to BANA; and BANA to Nations-tar. Martinez answered the complaint, counterclaimed against Nationstar, and cross-claimed against BANA and MERS *252 after joining them as third-party defendants, Martinez ' and Nationstar both moved for summary judgment. In June 2015, the state court denied Martinez’s motion, granted Nationstar’s, and transferred the action “back to the Office of Foreclosure to proceed as an uncontested matter.” App. at 155-56. In November 2015, Martinez and Nationstar entered into a loan modification agreement.
In December 2015, Martinez filed this action against BANA, Nationstar, and MERS. His claims were, in essence, based on alleged defects in the securitization of the mortgage and the related transfers of ownership, described in relevant part above. Martinez requested money damages under a breach-of-contract theory, as well as a declaration under 28 U.S.C. § 2201 concerning the enforceability of the mortgage. He premised the District Court’s subject matter jurisdiction on 28 U.S.C. § 1332(a).
MERS and Nationstar, joined by BANA (collectively, “Defendants”), moved to dismiss Martinez’s complaint under Fed. R. Civ. P. 12(b)(1) and 12(b)(6). Their motion asserted six bases for dismissal: (1) lack of subject matter jurisdiction, under Rooker-Feldman 2 ; (2) res judicata; (3) collateral estoppel (4) New Jersey’s Entire Controversy Doctrine; (5) lack of standing; and (6) mootness, in light of the loan modification.
The District Court granted Defendants’ motion. It determined that Martinez’s suit was barred by Rooker-Feldman, warranting dismissal under Fed. R. Civ. P. 12(b)(1). The District Court alternatively determined that Martinez’s complaint failed to state a claim, warranting dismissal under Fed. R. Civ. 12(b)(6), because his allegations were “too conclusory and speculative” and because “it is clear within this District that a mortgagor does not have standing to allege [that] an assignment between two third parties is invalid.” App, at 10. 3 The District Court denied Martinez leave to amend and dismissed his suit with prejudice. Martinez unsuccessfully moved for reconsideration, and then timely appealed.
II.
We have jurisdiction under 28 U.S.C. § 1291. We review de novo a district court’s decision to grant a motion to dismiss pursuant to either Federal Rule of Civil Procedure 12(b)(1) or 12(b)(6). Free Speech Coal., Inc. v. Att’y Gen. of U.S.,
III.
While we will affirm the judgment below, we do so on grounds different than *253 those provided by the District Court. We disagree that it lacked subject matter jurisdiction. 4 But we ultimately conclude that under New Jersey’s Entire Controversy Doctrine (the “ECD”), see N.J. Ct. R. 4:30A, Martinez’s complaint was properly dismissed under Fed. R. Civ. P. 12(b)(6). 5
Rooted in “the principle that the adjudication of a legal controversy should occur in one litigation in only one court,” Wadeer v. N.J. Mfrs. Ins. Co.,
The ECD is wider in scope than the federal law of res judicata, with which it shares a trio of requirements: “(1) the judgment in the prior action must be valid,
*254
final, and on the merits; (2) the parties in the later action must be identical to or in privity with those in the prior action; and (3) the claim in the later action must grow out of the same transaction or occurrence as the claim in the earlier one.” Watkins v. Resorts Int’l Hotel & Casino,
All three requirements of res judicata are satisfied in this case. First, the loan modification agreement coupled with the subsequent dismissal of the foreclosure case amounts to a final judgment on the merits. See Ford-CIifton v. Dep’t of Veterans Affairs,
Second, the Defendants were all parties to the state foreclosure case. Indeed, Martinez’s federal complaint and his responsive pleading in state court are identically captioned (save for the “John Doe” cross-claim defendants listed in the latter caption).
Third, we have little trouble determining that the core set of allegations animating Martinez’s federal claims is virtually, if not entirely, identical to that presented in support of his counterclaims and cross-claims in the foreclosure case. 6 Martinez appears to concede as much on appeal, arguing that “litigants can file the exact same suit twice, in identical federal and state actions.” Even ignoring that apparent concession, a review of the parallel pleadings confirms our assessment. 7 In both pleadings, Martinez averred that there were *255 defects in the securitization of his mortgage, that Nationstar and the securitization trust were never legitimate holders of the promissory note and mortgage, that improper assignments of the mortgage destroyed the chain of title, that Defendants lacked standing to foreclose, that the applicable pooling and servicing agreement was .violated, and that the mortgage was void and unenforceable.
Finally, in determining whether the state court judgment in Martinez’s foreclosure case should be given preclusive effect under New Jersey law, we consider the three purposes of the ECD: “(1) complete and final disposition of cases through avoidance of piecemeal decisions; (2) fairness to parties to an action and to others with a material interest in it; and (3) efficiency and avoidance of waste and delay.” Mullarkey,
IV.
Based on our determination that Martinez’s complaint was properly dismissed, we cannot say that it was an abuse of discretion for the District Court to withhold leave to amend and to deny reconsideration. In particular, any amendment of Martinez’s complaint would have been futile given the applicability of the ECD. Cf. Great W. Mining,
Notes
This disposition is not an opinion of the full Court and pursuant to I.O.P. 5.7 does not constitute binding precedent.
. The chronology of Martinez's pleaded narrative ends here. We continue our background recitation using the Nationstar/MERS supplemental appendix (cited "App.”).
. D.C. Ct of App. v. Feldman,
. The District Court discussed Martinez’s standing in the context of Rule 12(b)(6); i.e., not as a threshold jurisdictional issue. Cf. Lewis v. Alexander,
. In applying Rooker-Feldman, the District Court extrapolated from several of our non-precedential opinions a rule that • "federal courts are barred by the Rooker-Feldman doctrine from providing relief that would overturn a state court foreclosure decision.” App. at 7. Rooker-Feldman, however, does not have particular application depending on the genre of the underlying state court litigation. Additionally, in Great Western Mining & Mineral Co. v. Fox Rothschild LLP,
The purpose of Rooker-Feldman is not to prevent "duplicative” litigation, as Defendants suggest, see, e.g., BAÑA Br. at 17; that is instead the purpose of preclusion doctrines. What Rooker-Feldman does instead is preserve the hierarchy of appellate review in state court systems by precluding lower federal courts from exercising appellate jurisdiction over final state-court judgments: "such appellate jurisdiction rests solely with the United States Supreme Court.” In re Madera,
Martinez's federal action was filed before any resolution of the foreclosure case and thus was not tantamount to an appeal of an adverse state court judgment. See Great W. Mining,
We note the statement made by Nationstar and MERS in their joint brief on appeal that the foreclosure action "was dismissed on December 2, 2015,” Nationstar/MERS Br. at 3, almost one month before Martinez filed his federal action. Yet, Nationstar and MERS offer no citation to support their statement. The state foreclosure docket, of which we may take judicial notice, see, e.g., Oneida Motor Freight, Inc, v. United Jersey Bank,
. There is no dispute that New Jersey law ' determines the preclusive effect of a judgment issued by a New Jersey court. See Paramount Aviation Corp. v. Gruppo Agusta,
. The ECD "has a narrower application to foreclosure proceedings," Mullarkey,
. Defendants attached Martinez’s state court filings to their motion to dismiss. The District Court correctly recognized that it could .consider "matters of the public record” in deciding Defendants’ motion under Fed. R. Civ. P. 12(b)(6). See App. at 6 (quoting Mayer v. Belichick,
