
250 A.2d 354 (1969)
MAX GARELICK, INC.
v.
JOSEPH G. LEONARDO et ux.
No. 408-Appeal.
Supreme Court of Rhode Island.
February 12, 1969.
*355 Aram A. Arabian, Manuel A. DeCarvalho, providence, for plaintiff-appellant.
Joseph G. Kinder, William J. McGair, providence, for defendants-appellees.

OPINION
ROBERTS, Chief Justice.
This is a bill in equity brought to recover damages alleged to have resulted from a breach of contract and to enjoin an alleged continuing breach of that contract. The cause was heard by a justice of the superior court after the adoption of the new rules of civil procedure of that court, and thereafter a judgment was entered for the defendants. The plaintiff thereupon prosecuted an appeal to this court from that judgment.
The record discloses that on October 31, 1952, plaintiff Max Garelick, Inc., hereinafter referred to as Garelick, entered into a contract with Narragansett Brewing Company, hereinafter referred to as Narragansett, pursuant to which it agreed to purchase from Narragansett all the spent wet grain, a by-product of the brewing process, produced by it during the period January 1, 1953, through December 31, 1957. It further appears that Garelick then entered into a contract dated December 28, 1953, with Joseph G. Leonardo, the defendant, hereinafter referred to as Leonardo, pursuant to which all such grains purchased by Garelick from Narragansett would be sold to Leonardo for the period December 28, 1953, through December 31, 1957, inclusive.
The nineteenth paragraph of the contract between Garelick and Leonardo read in pertinent part: "19. b. During the period of this Agreement and for a period of five (5) years after the expiration hereof the Buyers will not directly or indirectly purchase spent wet grains from Narragansett." During the term of the two contracts above-mentioned it appears that Garelick brought suit against Narragansett for damages alleged to have resulted from the condition of the grain Narragansett had been delivering to Leonardo under its contract and that ultimately the litigation was settled after a payment by Narragansett to Garelick of $25,000.
In August 1957, Narragansett entered into a contract with Farmers Feed Company of New England, hereinafter referred to as Farmers Feed, whereby it agreed to sell all of its spent wet grains to Farmers Feed for the period beginning January 1, 1958, through December 31, 1967. Leonardo, while at the premises of Narragansett, was informed of the new contract to take effect in January 1958, and that pursuant to that contract Farmers Feed would take all of the spent wet grain produced by Narragansett. It further appears that Leonardo was told by a representative of Farmers Feed that the contract between Narragansett and Garelick was not to be renewed. Leonardo thereupon entered into a contract with Farmers Feed on November 8, 1957, pursuant to which he agreed to buy the spent wet grain produced at Narragansett from Farmers Feed, taking delivery at the premises of Narragansett. It is not disputed that since January 1, 1958, defendant has been taking such grain from the premises of Narragansett and is paying Farmers Feed for such grains.
It is to be noted that the total period of duration of the agreement by Leonardo not to purchase grain from Narragansett directly or indirectly extended to December 31, 1962. The trial in this case began on June 20, 1967, and, therefore, the issue of whether injunctive relief would be properly *356 ordered had become moot. The sole issue before the court then was whether Leonardo's purchases of grain from Farmers Feed after December 31, 1957, the terminal date of his contract with Garelick, constituted a violation of a valid restraint that would warrant the assessment of damages by the superior court. The situation was recognized by the superior court, and the case was tried accordingly.
We are confronted then with a very narrow issue. The defendant is urging vigorously that the provisions of paragraph 19 (b) of the agreement under consideration constitute an unreasonable restraint of trade and are, therefore, void. The trial justice took the view that the provisions of sec. 19 (b) as they relate to the time for which the restraint was to endure were divisible and that the agreement contemplated two separate periods of restraint. The court held that the first such period of restraint extended from the date of the contract between Garelick and Leonardo, pursuant to which Leonardo had agreed not to purchase grain from Narragansett, directly or indirectly, from December 28, 1953, through December 31, 1957. The latter date marks also the termination of Garelick's contract with Narragansett to purchase all of the grain it produced.
It is clear then that the trial justice concluded that the first period of restraint contemplated in the restrictive covenant was in fact the period of time in which Garelick had an exclusive contract with Narragansett for the purchase of grain, and it is conceded that during this period the agreement was not breached by Leonardo. It was the opinion of the trial justice that the second period of restraint extended over a period of five years, beginning December 31, 1957, which marked the termination, not only of Leonardo's contract with Garelick, but also Garelick's contract with Narragansett.
It is our opinion that the trial justice did not err in holding that the restrictive covenant under consideration was, as to the time element, divisible. He conceded that during both such periods of time the contract purported to restrict Leonardo from the purchase of grain directly or indirectly from Narragansett. There is an abundance of authority to the effect that when such restrictive covenants or restraints reasonably may be divided with respect to duration or territory included therein, the court will enforce so much of the agreement as is reasonable. North Shore Dye House, Inc. v. Rosenfield, 53 R.I. 279, 166 A. 346; Novelty Bias Binding Co. v. Shevrin, 342 Mass. 714, 175 N.E.2d 374. That Leonardo did not breach the restrictive covenant during the term of the contract between Garelick and Leonardo is not disputed. Rather, the issue presented to us is whether the court erred in holding that the restraint on Leonardo during the period of the five years following the termination of his contract with Garelick for the purchase and sale of the grain constituted an illegal restraint of trade and, if it were not, was it breached by the purchase of grain by Leonardo from Farmers Feed subsequent to December 31, 1957.
This court early adopted the doctrine of reasonableness for the determination of the validity of restrictive covenants and this whether they related to the sale of a business and the good will thereof or to noncompetitive agreements related to employment contracts. Oakdale Mfg. Co. v. Garst, 18 R.I. 484, 28 A. 973; Tillinghast v. Boothby, 20 R.I. 59, 37 A. 344; Koppers Products Co. v. Readio, 60 R.I. 207, 197 A. 441. In Oakdale Mfg. Co. v. Garst, supra, the court said at 489, 28 A. at 974: "The test of reasonableness is the test of validity in contracts of this kind. The test is to be applied according to the circumstances of the contract, and is not to be arbitrarily limited by boundaries of time and space. There has been much discussion upon this subject, which need not be repeated. The law has advanced, pari passu, with social progress to a point of practical unanimity. The rule, now generally received, has been recognized in this State, that contracts in restraint of trade are not necessarily void *357 by reason of universality of time, * * * nor of space * * *; but they depend upon the reasonableness of the restrictions under the conditions of each case."
It may be that our cases are not precise in defining the extent to which the court will go in enforcing reasonable restraints where they are set out in an agreement that contains other restrictive covenants that would be invalid as unreasonable. In Koppers Products Co. v. Readio, supra, the court said at 215, 197 A. at 444, that noncompetitive employment contracts are to be carefully scrutinized "* * * and only enforced when reasonable and when the restriction does not extend beyond what is apparently necessary for the protection of those in whose favor they are made." It is not clear from this language whether a restraint, if reasonable, would be enforced where the terms of the contract are not divisible. It appears, however, that where the terms of a contract are divisible and the restraints capable of being stated separately, either as to time or space, such of the restraints as are reasonable would be enforced, while those which are unreasonable would be rejected. We cannot perceive any sound reason why this rule should not be applied to restrictive covenants contained in agreements other than those arising out of employment contracts.
We hold then that where restrictive covenants contained in an agreement are divisible, the restraints set out therein will be valid to the extent that they are reasonably necessary for the protection of the interest of the person for whose benefit they are intended, are not unreasonably restrictive of the rights of the person who is so restrained, and are not contrary to public policy. This, in our opinion, is consistent with the majority view in this country. See Welcome Wagon, Inc. v. Haschert, 125 Ind. App. 503, 127 N.E.2d 103.
The question then is whether the restriction upon Leonardo's purchase of grain from Narragansett for a period of five years following December 31, 1957, was unreasonable and, therefore, an illegal restraint of trade that the court will not enforce. 2 Restatement, Contracts, § 515, sets forth a number of situations in which a restraint of trade is generally held to be unreasonable. Section 515 suggests that a restraint of trade is unreasonable if it "(a) is greater than is required for the protection of the person for whose benefit the restraint is imposed, or (b) imposes undue hardship upon the person restricted, or * * * (e) is based on a promise to refrain from competition and is not ancillary either to a contract for the transfer of good-will or other subject of property or to an existing employment or contract of employment." The trial justice rested his decision upon subsection (e), holding that the restraint imposed during the five-year period following December 31, 1957, was not ancillary to any contract or subject of property nor to a contract of employment.
While we do not disagree with the conclusion of the trial justice, it is our opinion that in the circumstances of this case this particular restraint was greatly in excess of that required for the protection of Garelick and, if enforced, would impose undue hardship upon Leonardo. It is clear from the factual situation disclosed here that as of December 31, 1957, Garelick's contract with Narragansett for the purchase of all of the grain produced by it had terminated and consequently it had no interest to protect during the ensuing five-year period. Obviously, the restraint was designed to protect Garelick's source of supply which he had contracted to deliver to Leonardo, but once that contract had expired, Garelick was left with no interest or right that the enforcement of the second restraint would protect.
Obviously, to enforce the second restraint would work considerable hardship on Leonardo, who, now unable to obtain the grain from Garelick, would be forbidden to seek such grains as he needed in his business from Narragansett or from *358 Farmers Feed, which now had a contract with Narragansett to take the grain it produced. In the circumstances we find that the restraint  imposed upon Leonardo by the terms of the contract prohibiting him from purchasing grain from Narragansett for a period of five years after the termination of Garelick's contract with Narragansett  was unreasonable, constitutes an illegal restraint, and will not be enforced.
The plaintiff's appeal is denied and dismissed, and the judgment for the defendants is affirmed.
