
750 A.2d 563 (2000)
2000 ME 79
Steven M. GOUMAS
v.
STATE TAX ASSESSOR.
Supreme Judicial Court of Maine.
Submitted on Briefs January 14, 2000.
Decided May 9, 2000.
*564 Steven M. Goumas, Farmington, NH, for plaintiff.
Andrew Ketterer, Attorney General, Crombie J.D. Garrett, Asst. Attorney General, Clifford B. Olson, Asst. Attorney General, Augusta, for defendant.
Before WATHEN, C.J., and CLIFFORD, RUDMAN, DANA, SAUFLEY, and CALKINS, JJ.
SAUFLEY, J.
[¶ 1] Steven Goumas appeals from a judgment entered in the Superior Court (Kennebec County, Studstrup, J.) dismissing as barred by the doctrine of res judicata his complaint, brought pursuant to 36 M.R.S.A. § 151 (1990 & Supp.1999) and M.R. Civ. P. 80C, in which Goumas challenged the State Tax Assessor's authority to assess income taxes on his income earned at the Portsmouth Naval Shipyard. Finding no error, we affirm.

I. BACKGROUND
[¶ 2] Steven Goumas is a New Hampshire resident employed as a civilian federal employee at the Portsmouth Naval Shipyard. Goumas asserts that the Shipyard is located in New Hampshire and not in Maine. Based on this belief, Goumas and other similarly situated New Hampshire residents filed a class action suit seeking relief from taxes due or refunds of taxes paid during tax years 1989 through 1992 and seeking inter alia a declaration that income of class members earned at the Shipyard "at any and all times" is not taxable by the State of Maine. The class was certified on October 3, 1994, representing nonresident employees of the Shipyard. The certification of the class required certain class members to continue to pursue administrative remedies regarding the assessment of each year's income taxes as time progressed. Accordingly, members of the class were required to file timely challenges to the assessment of taxes, but resolution and enforcement of the taxes was effectively stayed throughout the pendency of the class action. See, e.g., 36 M.R.S.A. § 175-A (1990 & Supp.1999).
[¶ 3] Goumas and the other members of the class, however, failed to prosecute their action. On June 12, 1998, the Superior Court dismissed the suit with prejudice for failure to prosecute. While the class action was pending, Goumas had continued to challenge the Assessor's annual determination that he owed income taxes to the State of Maine. Consistent with the requirements of his certification as a class member, in 1997, Goumas sought a reconsideration of the Assessor's determination that he owed Maine income taxes for tax years 1992 through 1995. The Assessor concluded that the assessments were not in error. On October 15, 1997. Goumas appealed the Assessor's reconsideration decisions to the Superior Court pursuant to 36 M.R.S.A. § 151 and M.R. Civ. P. 80C. Because resolution of the class action would render the obligatory Rule 80C action moot, no action was taken on the Rule *565 80C complaint pending final judgment in the class action.
[¶ 4] Once the class action suit was dismissed with prejudice, the Superior Court addressed Goumas's Rule 80C complaint, and, after motion and hearing, dismissed the complaint because Goumas was a member of the class and could not, therefore, relitigate the same cause of action regarding Maine's authority to tax his income. This appeal followed.

II. DISCUSSION
[¶ 5] We review de novo the Superior Court's legal conclusion that the current claim is barred by the application of the doctrine of res judicata. See Draus v. Town of Houlton, 1999 ME 51, ¶ 5, 726 A.2d 1257, 1259. Res judicata bars the relitigation of "an entire `cause of action.'" Johnson v. Samson Constr. Corp., 1997 ME 220, ¶ 6, 704 A.2d 866, 868 (quoting Beegan v. Schmidt, 451 A.2d 642, 644 (Me. 1982)). The doctrine applies only when: "(1) the same parties or their privies are involved in both actions; (2) a valid final judgment was entered in the prior action; (3) the matters presented for decision in the second action were, or might have been, litigated in the first action." Department of Human Servs. v. Comeau, 663 A.2d 46, 48 (Me.1995); and (4) both cases involve the same cause of action, see Camps Newfound/Owatonna Corp. v. Town of Harrison, 1998 ME 20, ¶ 11, 705 A.2d 1109, 1113.
[¶ 6] Here, the first three elements are indisputably present. First, both Goumas and the Assessor, the parties before us, were parties in the class action. Second, the first suit was decided on the merits, and a valid final judgment was entered. See Johnson v. Samson Constr. Corp., 1997 ME 220, ¶ 8, 704 A.2d 866, 869. And third, the "matters presented for decision" in the class action case included the adjudication of Goumas's challenge to the taxability of his income earned at the Shipyard, for all tax years through and including those he seeks to challenge here. Accordingly, the applicability of the doctrine of res judicata to this matter rests on the fourth element: whether the two suits involve the same cause of action.
[¶ 7] In determining whether two cases involve the same cause of action, we apply the "transactional test." Draus, 1999 ME 51, ¶ 8, 726 A.2d at 1260. Under this test, causes of action are the same if they were "founded upon the same transaction, arose out of the same nucleus of operative facts, and sought redress for essentially the same basic wrong." Brown v. Osier, 628 A.2d 125, 127 (Me.1993), quoted in Draus, 1999 ME 51, ¶ 8, 726 A.2d at 1260. The transactional test, requiring that the court analyze the factual groupings that can be aggregated for trial, is a "pragmatic" test. Beegan, 451 A.2d at 644. This conceptualization of the doctrine of res judicata requires "a plaintiff to pursue all rights that he may have against a given defendant arising out of the `transaction or series of transactions' from which his suit arises." Id. at 646.
[¶ 8] In his first action, as a member of the class, Goumas asserted that he was a resident of New Hampshire; that he earned income at the Portsmouth Naval Shipyard; that the State Tax Assessor had assessed and declined to return income taxes against his earnings at the Shipyard; that the Shipyard is located in Portsmouth, New Hampshire, and "has never been located within the State of Maine"; and that income earned at the Shipyard is "not properly subject to Maine Income Tax." The court consolidated the action filed by Goumas and others with another pending action that also challenged the taxing of income earned at the Shipyard.
[¶ 9] The court certified two classes and defined the Goumas class as consisting of "all nonresident individuals (for Maine income tax purposes) who were, are or will become Federal civilian employees who have timely pursued or actually do timely pursue their administrative remedies" on the grounds that the Shipyard is not located *566 in Maine (emphasis added).[1] The language of certification makes evident the scope of the class action. It was intended to address past and future assessments of Maine income taxes against the members of the class. At the time that the action was eventually dismissed for want of prosecution, the court noted that the pendency of the action had not only prevented the State of Maine from collecting back taxes from members of the class but also that the plaintiffs had filed suit "to prevent collection for the indefinite future, while they do nothing to pursue the litigation."
[¶ 10] The document that brings Goumas before us now, filed in the Superior Court, consisted of a two-paragraph letter, purporting to be a complaint, in which he petitioned for review of his 1992 through 1995 taxes and set forth exactly the same argument: "My contention is that the Portsmouth Naval Shipyard is located in Rockingham County, Portsmouth, New Hampshire, and that the State of Maine has no jurisdiction in taxing my wages for State of Maine income tax purposes." As is apparent, both the class action suit and the current complaint are "founded upon the same nucleus of operative facts." Both suits were generated by the actions of the State of Maine in taxing Goumas's income and both presented the same cause of action determining whether the State of Maine is authorized to tax the income of nonresident civilian employees at the Portsmouth Naval Shipyard.[2]
[¶ 11] Moreover, Goumas seeks exactly the same remedy in the matter before us as he did in the class actiona judicial determination that the State of Maine may not impose an income tax on him because his income was earned in New Hampshire. Because Goumas has already litigated his claim that the State of Maine may not impose an income tax upon his Shipyard earnings for the tax years 1992 through 1995 as well as other years, and failed to prevail in that litigation, he may not now relitigate the same cause of action.
[¶ 12] Accordingly, we conclude that the two suits were founded on the same nucleus of facts and sought the same redress, thus constituting the same cause of action for purposes of the doctrine of res judicata. The Superior Court, therefore, did not err in concluding that the current suit is barred.
The entry is:
Judgment affirmed.
NOTES
[1]  A second class was certified to include residents of New Hampshire earning income at the Shipyard who had not or did not perfect their challenges against the Assessor. Relief for those class members would be granted only prospectively through declaratory and injunctive relief.
[2]  Goumas does not challenge the amount, calculation, or basis of the taxes assessed by the State Tax Assessor except to argue that the Shipyard is not in Maine and, thus, that the Assessor lacked the authority to assess taxes on income earned there.
