Mass. Gen. Laws ch. 240 § 11
If the title to land appears of record to be affected by a possible condition, restriction, reservation, stipulation or agreement made or imposed more than thirty years prior to the commencement of the proceedings hereinafter provided for, a person having a freehold estate, vested or contingent, in possession, reversion or remainder, in said land, or in any undivided or any aliquot part thereof, or any interest therein which may become a freehold estate, and any person who has conveyed such estate or any such interest therein with covenants of title or warranty, may file a petition on oath in the land court to determine the validity, or define the nature and extent, of such possible condition or other encumbrance, against any person who might be entitled in any event to enforce it or avail himself thereof. Two or more persons owning in severalty different portions of such estate or different interests therein may join in such petition, or two or more such defects of the same general character in the title to the same parcel of land or to different portions of the same parcel of land may be set forth in the same petition, and if the petition is contested the court shall make an appropriate order for separate issues.
Mass. Gen. Laws ch. 240, § 11