
87 N.W.2d 446 (1958)
In the Matter of the ESTATE OF Gust HOELSCHER, Deceased. Marcus Hoelscher, Administrator.
Don W. BARKER, Appellee,
v.
Marcus HOELSCHER, Administrator of the Estate of Gust Hoelscher, Deceased, Appellant.
No. 49328.
Supreme Court of Iowa.
January 14, 1958.
*448 Lundy, Butler, Lundy & Wilson, Eldora, for appellant.
Bateson & Ryan, Eldora, for appellee.
WENNERSTRUM, Justice.
The holder by assignment of four promissory notes previously given to A. C. Thornburg by Gust Hoelscher, now deceased, filed a claim on said notes in his estate. Previously and on November 12, 1949 Gust Hoelscher had brought an action against A. C. Thornburg for the cancellation of these notes and for general equitable relief. The court in that action, after a trial, dismissed the petition on December 19, 1950. It is the claim of the defendant administrator in the present action a counterclaim on the notes should have been filed in the first action by reason of the provisions of Rule 29, R.C.P., 58 I.C.A. The trial court held against this contention and allowed the claim on the notes. The defendant has appealed.
The four notes which are the basis of plaintiff's claim were given during the year 1946. At that time A. C. Thornburg was the president of the Iowa Falls State Bank and he and his wife held a controlling interest in it. The notes when given were made payable to the Iowa Falls State Bank. Each of the notes bears the endorsement "Iowa Falls State Bank, A. C. Thornburg, President". It appears that while A. C. Thornburg was in active charge of the bank he would take certain loans himself, furnish the necessary money from his own personal funds and take over the note or notes. Apparently this was the situation as pertains to the Hoelscher notes.
In connection with a claim regarding the ownership of the obligations and the liability on them Gust Hoelscher brought an action in the Hardin County District Court against A. C. Thornburg, wherein he claimed, he did not owe anything on the notes held by Thornburg, that although they may purport to be payable to the Iowa Falls State Bank he received no money or anything of value from the bank, that despite the fact the notes may bear an endorsement purporting to have been made by the bank such endorsement was not made by it or by authority of it, and although Thornburg claims to be the owner of said notes and Hoelscher denies liability on them no action has been brought by Thornburg thereon. It was further therein alleged that on account of the matters set forth in the petition there was a justiciable controversy between the plaintiff and defendant which was subject to consideration by a court of equity. The plaintiff in that action, Gust Hoelscher, asked that he have judgment and decree against the defendant, A. C. Thornburg, cancelling the said promissory notes, setting the same aside and relieving the plaintiff from any liability thereon. He asked for further equitable relief.
The defendant, A. C. Thornburg, in the earlier action admitted in his answer he was the possessor and owner of the four promissory notes in question and further claimed that these notes are obligations of the plaintiff Gust Hoelscher. He asked that the plaintiff's petition be dismissed. In the court's finding it held the plaintiff had failed to sustain his petition and it should be dismissed at plaintiff's cost. The judgment and decree as therein entered is as follows:

"Judgment
"It is therefore ordered, adjudged and decreed that the plaintiff's petition be and it is hereby dismissed, and the costs * * * be taxed against the plaintiff and judgment is hereby rendered therefor.
"The Plaintiff excepts to each adverse ruling, finding, order and decree."
In the present action there are attached to the answer of the administrator the pleadings to which we have referred. There are also attached the findings of the *449 court and its judgment and decree. Sometime during the summer of 1956 A. C. Thornburg transferred the four promissory notes involved in this and the first case to Don W. Barker, the claimant. On July 26, 1956 he filed his claim against the estate of Gust Hoelscher based upon the claimed obligations.
In the answer to the present action the defendant stated, in part: "3rd. That the promissory notes which are the basis of the claim of the said Don W. Barker and which are referred to therein were all matured at the time of the commencement of the litigation hereinbefore referred to in Paragraphs 1st and 2nd of this Answer and they were not then the subject of a pending action; and at said time the said A. C. Thornburg, under the terms and provisions of Rule 29 of the Iowa Rules of Civil Procedure, was possessed of and held a compulsory counterclaim upon said promissory notes for judgment against Gust Hoelscher for the amount evidenced by them, but the said A. C. Thornburg failed to file any pleading containing such counterclaim. * * *
"4th. That the said A. C. Thornburg having so failed to make such counterclaim, and the Court having entered a final judgment and decree on the merits in said cause, said counterclaim became and was barred; that said Don W. Barker was the lawyer representing the said A. C. Thornburg at the trial of the cause hereinbefore referred to, and at a time after the entry of judgment and decree and with full knowledge of all of the facts hereinbefore set forth, and after maturity, the Claimant acquired the said promissory notes upon which he asks for allowance of his claim in this Estate.
"5th. That by reason of all the foregoing Claimant is barred from allowance of his claim under the provisions of Rule 29 of the Iowa Rules of Civil Procedure."
Consequently the issue involved in the present action is whether the court erred in allowing Barker's claim and in doing so failed to correctly interpret and apply the provisions of Rule 29, R.C.P. This rule, which pertains to compulsory counterclaims, is as follows: "A pleading must contain a counterclaim for every cause of action then matured, and not the subject of a pending action, held by the pleader against any opposing party and arising out of the transaction or occurrence that is the basis of such opposing party's claim, unless its adjudication would require the presence of indispensable parties of whom jurisdiction cannot be acquired. A final judgment on the merits shall bar such a counterclaim, although not pleaded."
I. It was the trial court's conclusion the first case was an action for declaratory judgment. The defendant administrator maintains his suit, the first one, was not of such a nature inasmuch as the action was for the cancellation of the notes and for equitable relief. He further contends in the judgment and decree of dismissal there was no declaration of rights but the judgment and decree entered was for an absolute dismissal.
The only reference in the first action which might make possible a determination it was one for a declaratory judgment is the statement incorporated in the petition as follows: "5. That on account of the matters and things set forth herein a justiciable controversy has arisen as between plaintiff and defendant cognizable in equity." We do not believe an allegation in a petition that there is a "justiciable controversy" in itself will justify a holding a declaratory judgment action had been instigated. It should be kept in mind the prayer of the petition did not ask for a " * * * declaration of rights, status or legal relations" pertaining to the notes. Rule 262, R.C.P. All that is asked in the prayer of the petition in the first case is that there be entered a " * * * judgment and decree against the defendant cancelling the said promissory notes, setting the same aside and relieving this plaintiff from any liability thereon." And "2nd. That he *450 have such other and further relief as equity may direct in his favor and that he have costs of suit."
The situation disclosed by the pleadings indicates at the most there was a difference of opinion as to the legality of the notes in question. Relative to such a situation it is stated in Seiz v. Citizens Pure Ice Co., 207 Minn. 277, 290 N.W. 802, 804, in regard to an action for declaratory judgment: "* * * Mere differences of opinion with respect to the rights of parties do not constitute such a controversy. * * "
In Melsha v. Tribune Pub. Co., 243 Iowa 350, 353, 51 N.W.2d 425, 427, we made a comment which is applicable to the present case: "The prayer of the petition must be examined in determining what constitutes the subject matter of litigation for judicial purposes. * * *" See also Federal Land Bank of Omaha v. Jefferson, 229 Iowa 1054, 295 N.W. 855, 132 A.L.R. 1282, and cases cited. We are unable to hold the first action was one for a declaratory judgment. Inasmuch as it is our determination the first case was not of a declaratory judgment nature we do not deem it necessary to pass on the question whether a compulsory counterclaim must be pleaded in such a proceeding.
II. Rule 29, R.C.P., is based on Federal Rule 13(a), F.R.Civ.P., 28 U.S.C.A. Cook's Iowa Rules of Civil Procedure, Vol. 1, p. 204. However, the last sentence is not included in the federal rule.
In Cook's Iowa Rules of Civil Procedure, Vol. 1, p. 205, it is stated: "The counterclaim is compulsory where it arises out of the transaction or occurrence that is the basis of the opposing party's claim if: "1. It is then matured. 2. If it is not the subject of a pending action. 3. It must be held by the pleader against the opposing party. 4. It must not require the presence of indispensable parties of whom jurisdiction cannot be acquired."
Considering the factors which necessitate the pleading of a compulsory counterclaim, as previously set forth, it must be held the defendant's (Thornburg) notes had matured inasmuch as each of them was past due at the time of the first suit. Likewise, there was no showing there was any pending action for the collection of them. There is also no question but what the defendant (Thornburg) held the notes which had been given by the plaintiff; and there are no facts stated or shown that the pleading of the counterclaim would require the presence of indispensable parties of whom jurisdiction cannot be acquired.
It is thus apparent the four essential elements which would require the pleading of a compulsory counterclaim are shown to be present.
Inasmuch as the Iowa Rule 29, R.C.P., is based on a Federal rule of the same nature the interpretation by federal courts of the federal rule is highly persuasive. Best v. Yerkes, 247 Iowa 800, 812, 77 N.W.2d 23, 33. In United Artists Corp. v. Masterpiece Productions, 2 Cir., 221 F.2d 213, 216, in commenting on the question of a compulsory counterclaim it is stated: " * * * A counterclaim is compulsory under F.R. 13(a) `if it arises out of the transaction or occurrence that is the subject matter of the opposing party's claim.' In practice this criterion has been broadly interpreted to require not an absolute identity of factual backgrounds for the two claims, but only a logical relationship between them. * * *"
See also Lesnik v. Public Industrial Corp., 2 Cir., 144 F.2d 968, 975; Moore v. New York Cotton Exchange, 270 U.S. 593, 610, 46 S.Ct. 367, 371, 70 L.Ed. 750, 45 A.L.R. 1370; The Compulsory Counterclaim under Modern Pleading, 39 Iowa Law Review 255.
And in Rosenthal v. Fowler, D.C., 12 F.R.D. 388, 391, it is stated: "If there be one compelling test of compulsoriness, it *451 seems clearly to be that of the logical relationship of all claims in any given litigation. Lesnik v. Public Industrials Corporation, 2 Cir., 1944, 144 F.2d 968; Moore v. New York Cotton Exchange, 1926, 270 U.S. 593, 46 S.Ct. 367, 70 L.Ed. 750. If that logical relationship exists between a counterclaim and the main claim, then the counterclaim is compulsory and need not have independent jurisdiction to support it. * *"
In Phelan v. Middle States Oil Corporation, D.C., 124 F.Supp. 728, 803, there is a statement which can be applied to the facts in the present case: "On the whole it would be better to call this counterclaim compulsory(1) because of its logical connection with the subject matter of the primary claim, (2) because the facts on which to enter a judgment are before the Court, (3) because it would be a tremendous waste to compel the parties to present the same facts to another trier in a new proceeding, (4) because neither party is prejudiced by having this Court adjudicate the issues raised in the counterclaim."
Applying the last quoted statement we find there was a logical connection between the claim of the plaintiff in the first action and the defendant's interest in the ownership and collection of the notes; the subject matter from which a judgment could be entered was before the court; it would be a waste of judicial time and effort to require the parties to present the same facts in a new proceedings; and neither party would be prejudiced by having the court adjudicate all the issues which might be raised.
And in Korvette Co., Inc. v. Parker Pen Co., D.C.S.D.N.Y., 17 F.R.D. 267, 269, a further statement concerning the question of pleading a compulsory counterclaim, is as follows: "* * * Thus, the test to be applied in determining whether or not a compulsory counterclaim exists is whether there is any logical relationship between the claim now advanced by plaintiffs and the claim previously asserted by this defendant." We conclude there was a logical relationship between the notes in the present estate claim case and the first action regarding their validity.
III. There is a further phase of this case on which we should comment. We refer to that part of the rule which relates to claims "* * * arising out of the transaction or occurrence that is the basis of such opposing party's claim. * * *" In Brinkmann v. Common School District No. 27, Mo.App., 238 S.W.2d 1, 6, in referring to the necessity of pleading damages on a teacher's contract where the school district had brought an injunction action to prevent the teacher from endeavoring to render service the Missouri Court stated in passing on a compulsory counterclaim statute similar to our rule as follows: "In the case at bar the `transaction or occurrence' that constituted the `subject matter' of appellants' claim on which they brought their injunction suit was the dispute over the question of whether respondent had a valid contract to teach the school. Appellants claimed respondent had no contract to teach. Appellant (appellee) claimed he had a valid new contract to teach. It thus appears that before and at the time respondent filed his pleading in the injunction suit, all the elements provided by the statute, Section 73 [V.A.M.S. § 509.420], supra, to make the filing of a counterclaim compulsory were present in respondent's claim for his salary including the element that no third party's presence was necessary for its adjudication.
"It is unfortunate that respondent who was held to be right in the injunction suit, and who prevailed against appellants in that suit, must be denied recovery of his salary because he did not assert his claim as a counterclaim in that suit as required by Section 73, supra. However, that is the clear legislative policy of the State as written into the new Civil Code in Section 73, supra, and we cannot lawfully reach any other conclusion. It is the plain duty of courts to apply the law as written by the Legislature and leave to that tribunal the *452 matter of determining questions of legislative policy."
And in Brunswig Drug Co. v. Springer, 55 Cal.App.2d 444, 130 P.2d 758, 761, there were discussed the effects of a California compulsory counterclaim statute and it was therein stated: "* * * A party cannot by negligence or design withhold issues and litigate them in consecutive actions. Sutphin v. Speik, 15 Cal.2d 195, 202, 99 P.2d 652, 101 P.2d 497. He may not split his demands or his defenses. Elm v. Sacramento Suburban Fruit Lands Co., 217 Cal. 223, 17 P.2d 1003; 15 R.C.L., § 226, p. 969. Equity will not deal with a case by piecemeal. Bank of America, etc., v. Feig, 21 Cal. App.2d 247, 252, 68 P.2d 985; 10 Cal.Jur. 496."
The cited cases in this division have application in the present situation and are persuasive. See also Reconstruction Finance Corp. v. First National Bank, D.C. Wyo., 17 F.R.D. 397, 403.
IV. The concluding sentence in Rule 29, R.C.P. is as follows: "* * * A final judgment on the merits shall bar such a counterclaim, although not pleaded." Consequently we must determine whether the judgment of dismissal in the first case was a final judgment on the merits. The trial court held it was not of such a nature.
In Rule 217, which pertains to the effect of dismissal it is stated: "All dismissals not governed by rule 215 or not for want of jurisdiction or improper venue, shall operate as adjudications on the merits unless they specify otherwise." The dismissal in the first case was not a voluntary dismissal. Rule 215. It was not a dismissal for want of jurisdiction or improper venue. Rule 217. Consequently it was an adjudication on the merits under the last referred to rule. And under Rule 29, R.C.P. a final judgment on the merits will bar a compulsory counterclaim.
V. For the reasons heretofore set forth it is our holding the trial court was in error in allowing the claim against the estate and in not holding the notes should have been pleaded as a compulsory counterclaim in the first action. The cause is reversed and remanded for the entry of an order in the estate proceedings in keeping with our holding here announced.
Reversed and remanded.
All Justices concur, except SMITH, J., who takes no part.
