delivered the opinion of the court:
Plaintiff, Vince Torcasso, doing business as Mazz Media (Tor-casso), brought an action in the circuit court of Cook County against defendants Richard Swoboda and Standard Outdoor Sales, Inc. (Swo-*501boda). Torcasso alleged that Swoboda breached a brokerage contract and committed fraud.
The trial court granted Swoboda’s motion to dismiss Torcasso’s amended complaint. The court ruled that the action was barred by principles of res judicata and collateral estoppel. Torcasso appeals, assigning error to the dismissal.
We affirm the order of the trial court.
Background
The trial court dismissed the complaint pursuant to section 2— 619(a)(4) of the Code of Civil Procedure. (Ill. Rev. Stat. 1989, ch. 110, par. 2 — 619(aX4).) In ruling on a section 2 — 619 motion to dismiss, a court may consider the pleadings, affidavits in support of the motion, answers to interrogatories, depositions, and other proofs presented by the parties. Bloomingdale State Bank v. Woodland Sales Co. (1989), 186 Ill. App. 3d 227, 232, 542 N.E.2d 435, 438 (and cases cited therein).
A
The record contains the following pertinent facts. On March 4, 1988, Swoboda sued Torcasso for breach of a brokerage agreement. Swoboda alleged as follows. Torcasso owned an outdoor sign. On May 15, 1984, Torcasso and Swoboda orally agreed that Swoboda would procure an advertiser who would rent advertising space on Torcasso’s sign. In return, Torcasso would pay Swoboda a commission. Swoboda did procure an advertiser for Torcasso. Swoboda demanded his commission. Torcasso only partially paid; he owed Swoboda $2,050 plus interest. Swoboda sought that amount in damages; he also sought interest and costs.
In his answer, Torcasso admitted the existence of the oral brokerage agreement. However, Torcasso denied that Swoboda procured an advertiser. Torcasso, consequently, denied that he owed Swoboda a commission and admitted that he refused to pay.
Torcasso also raised an affirmative defense. Torcasso alleged that he and Swoboda terminated the brokerage agreement on approximately October 15, 1984. By that time, Swoboda had not procured an advertiser. Torcasso subsequently found an advertiser. Torcasso sought a dismissal of Swoboda’s lawsuit.
The cause was tried before the court. On November 18, 1988, the trial court entered judgment for Swoboda in the amount of $3,400.
*502B
On March 14, 1989, approximately four months subsequent to the judgment in Swoboda’s lawsuit, Torcasso brought the present action against Swoboda. Torcasso amended his complaint on July 18, 1990. The complaint contained two counts. In count I, Torcasso acknowledged the existence of the brokerage agreement. However, he alleged that Swoboda breached the agreement by failing to use his “best efforts” to procure an advertiser.
In count II of his present complaint, Torcasso alleged fraud. Tor-casso alleged that Swoboda told Torcasso and prospective advertisers that the vacant sign space had been rented. However, the sign had not been rented to anyone. Swoboda allegedly made these misrepresentations to prevent the sign space from being rented to anyone other than Swoboda’s usual clients. Further, Torcasso relied on Swo-boda’s misrepresentations to his detriment. Torcasso sought $12,000 in compensatory damages in both counts, and an additional $20,000 in punitive damages in count II.
Swoboda moved to dismiss the amended complaint pursuant to section 2 — 619(a)(4) of the Code of Civil Procedure. (Ill. Rev. Stat. 1989, ch. 110, par. 2 — 619(a)(4).) He claimed that Torcasso’s lawsuit was barred under the theories of res judicata and collateral estoppel.
On October 10, 1990, the trial court granted Swoboda’s motion to dismiss. The court subsequently denied Torcasso’s motion to reconsider. Torcasso timely appeals.
Opinion
The trial court dismissed the complaint pursuant to the Code of Civil Procedure section 2 — 619(a)(4). Subsection (a)(4) provides as a ground for dismissal “[t]hat the cause of action is barred by a prior judgment.” (Ill. Rev. Stat. 1989, ch. 110, par. 2 — 619(a)(4).) The trial court ruled that Swoboda’s prior lawsuit and resulting judgment barred Torcasso’s lawsuit, based on either res judicata or collateral estoppel.
The doctrine of res judicata provides that a final judgment rendered by a court of competent jurisdiction is conclusive as to the rights of the parties and their privies and, as to them, constitutes an absolute bar to a subsequent action involving the same claim, demand, or cause of action. (Hilti, Inc. v. Griffith (1978), 68 Ill. App. 3d 528, 532, 386 N.E.2d 63, 65.) The rule embraces not only all matters that were actually litigated in the prior case, but also extends to all matters that should have been or could have been litigated. Baird & *503Warner, Inc. v. Addison Industrial Park, Inc. (1979), 70 Ill. App. 3d 59, 64, 387 N.E.2d 831, 837, quoting Prochotsky v. Union Central Life Insurance Co. (1971), 2 Ill. App. 3d 354, 356-57, 276 N.E.2d 388, 390.
Res judicata is based on the principle that the law grants every person an opportunity to present his or her case on the issues in question, but requires that person to put forth all grounds of recovery he or she has. (Morris v. Union Oil Co. (1981), 96 Ill. App. 3d 148, 154, 421 N.E.2d 278, 283.) “This rule is founded upon the plainest and most substantial justice, that litigation should have an end and that no person should be unnecessarily harassed with a multiplicity of suits.” Baird & Warner, 70 Ill. App. 3d at 64, 387 N.E.2d at 7.
Thus, to apply the doctrine of res judicata, a court must determine whether the two lawsuits involve the same cause of action. The test that Illinois courts generally use to determine this is whether the evidence needed to sustain the second action would have sustained the first action, i.e., whether the causes of action arise out of a single group of operative facts. Morris, 96 Ill. App. 3d at 156-57, 421 N.E.2d at 284-85; Hilti, 68 Ill. App. 3d at 532, 386 N.E.2d at 65-66, quoting Pierog v. H.F. Karl Contractors, Inc. (1976), 39 Ill. App. 3d 1057, 1060-61, 351 N.E.2d 249, 252.
Torcasso argues that he was not required to plead his allegations as a counterclaim in Swoboda’s prior lawsuit. Rather, Torcasso argues, he could bring a subsequent independent lawsuit.
Torcasso invokes section 2 — 608 of the Code of Civil Procedure, formerly section 38 of the Civil Practice Act (Ill. Rev. Stat. 1977, ch. 110, par. 38). Section 2 — 608(a) provides that any defendant, who desires to seek a judgment against any existing party to a lawsuit, may assert a counterclaim. (Ill. Rev. Stat. 1989, ch. 110, par. 2 — 608(a).) The provision is designed to simplify litigation by allowing all issues to be tried in one forum at the same time. However, the word “may,” which is used in the provision, indicates that the provision is permissive rather than mandatory. Miller v. Bank of Pecatonica (1980), 83 Ill. App. 3d 424, 426-27, 403 N.E.2d 1262, 1264; Ill. Ann. Stat., ch. 110, par. 2 — 608, Historical & Practice Notes, at 183 (Smith-Hurd 1983).
Thus, a defendant is not required under section 2 — 608(a) to immediately assert his or her rights by way of a counterclaim if it would be inconvenient or strategically inadvisable to do so. Rather, the defendant may assert the claim in a subsequent independent action. (Keith v. B & B Builders Supply, Inc. (1981), 101 Ill. App. 3d 1123, 1125, 428 N.E.2d 1194, 1196.) However, if a defendant’s claim *504involves the same operative facts as the plaintiff’s claim, the doctrine of res judicata may operate to bar the subsequent independent action. Block & Co. v. Storm Printing Co. (1976), 40 Ill. App. 3d 92, 96, 351 N.E.2d 271, 274; 2 C. Nichols, Illinois Civil Practice §1314 (1990).
Applying these principles to the present case, we conclude that a single group of operative facts is at the heart of both Swobo-da’s prior lawsuit and Torcasso’s subsequent lawsuit — the performance of the brokerage agreement. As we stated earlier, Swoboda alleged in his prior lawsuit essentially that he performed the brokerage agreement and was entitled to a commission. Torcasso alleged in his answer essentially that they terminated the agreement and that Swo-boda had not procured an advertiser for the sign.
The trial court entered judgment in favor of Swoboda. The major issues that were necessarily resolved in Swoboda’s prior lawsuit were that he performed the brokerage agreement, i.e., he procured an advertiser who was ready, willing, and able to rent sign space, and that he was entitled to a commission.
In count I of his present complaint, Torcasso alleges that Swoboda failed to use his “best efforts” to procure an advertiser. In count II, Torcasso alleges that Swoboda committed fraud by telling Torcasso and prospective advertisers that the vacant sign space had already been leased when it had not. Torcasso allegedly relied on these misrepresentations to his detriment. However, the trial court already decided that Swoboda did procure an advertiser and was entitled to a commission. The evidence needed to sustain Torcasso’s present lawsuit would have controlled the outcome of Swoboda’s lawsuit.
The underlying facts are the same in these two lawsuits; both suits are based upon the same brokerage agreement and the acts of the parties surrounding the agreement. Torcasso merely relabelled the theories of recovery. (See Morris, 96 Ill. App. 3d at 157, 421 N.E.2d at 285.) “The mere fact that different claims are alleged is immaterial; the assertion of different kinds or theories of relief still constitutes a single cause of action if a single group of operative facts give rise to the assertion of relief.” Baird & Warner, 70 Ill. App. 3d at 64, 387 N.E.2d at 838.
In Torcasso’s present lawsuit, what is at issue are matters involving the brokerage agreement. Torcasso could have raised these matters as a defense or counterclaim in Swoboda’s initial action. (See McLain v. West Suburban Hospital Medical Center (1990), 208 Ill. App. 3d 613, 616, 567 N.E.2d 532, 534.) It was the duty of Torcasso “to litigate the issues with respect to that contract in those proceedings, and his failure to do so constitutes a bar to a subsequent action *505involving the same contract.” (Douglas v. Papierz (1970), 121 Ill. App. 2d 242, 247, 257 N.E.2d 570, 573.) “Indeed, any contrary view would be counter to the accepted rule that a judgment fixing contractual rights and damages in a given dispute acts as a bar to any further action by the same parties with respect to the same dispute.” (International Industrial Leasing, Ltd. v. H.J. Coleman & Co. (1978), 66 Ill. App. 3d 884, 890-91, 384 N.E.2d 1, 6.) We uphold the trial court’s ruling that, based on the doctrine of res judicata, the judgment entered in Swoboda’s prior lawsuit barred Torcasso’s subsequent lawsuit.
For the foregoing reasons, the order of the circuit court of Cook County, which dismissed Torcasso’s amended complaint, is affirmed.
Affirmed.
JOHNSON and McMORROW, JJ., concur.