(2)
by inserting after subsection (n) the following new subsection:
“(o) Special Rules for Applying Nondiscrimination Rules to Protect Older, Longer Service and Grandfathered Participants.—
“(1) Testing of defined benefit plans with closed classes of participants.—
“(A) Benefits, rights, or features provided to closed classes.—A defined benefit plan which provides benefits, rights, or features to a closed class of participants shall not fail to satisfy the requirements of subsection (a)(4) by reason of the composition of such closed class or the benefits, rights, or features provided to such closed class, if—
“(i) for the plan year as of which the class closes and the 2 succeeding plan years, such benefits, rights, and features satisfy the requirements of subsection (a)(4) (without regard to this subparagraph but taking into account the rules of subparagraph (I)),
“(ii) after the date as of which the class was closed, any plan amendment which modifies the closed class or the benefits, rights, and features provided to such closed class does not discriminate significantly in favor of highly compensated employees, and
“(iii) the class was closed before April 5, 2017, or the plan is described in subparagraph (C).
“(B) Aggregate testing with defined contribution plans permitted on a benefits basis.—
“(i) In general.—For purposes of determining compliance with subsection (a)(4) and section 410(b), a defined benefit plan described in clause (iii) may be aggregated and tested on a benefits basis with 1 or more defined contribution plans, including with the portion of 1 or more defined contribution plans which—
“(I) provides matching contributions (as defined in subsection (m)(4)(A)),
“(II) provides annuity contracts described in section 403(b) which are purchased with matching contributions or nonelective contributions, or
“(III) consists of an employee stock ownership plan (within the meaning of section 4975(e)(7)) or a tax credit employee stock ownership plan (within the meaning of section 409(a)).
“(ii) Special rules for matching contributions.—For purposes of clause (i), if a defined benefit plan is aggregated with a portion of a defined contribution plan providing matching contributions—
“(I) such defined benefit plan must also be aggregated with any portion of such defined contribution plan which provides elective deferrals described in subparagraph (A) or (C) of section 402(g)(3), and
“(II) such matching contributions shall be treated in the same manner as nonelective contributions, including for purposes of applying the rules of subsection (l).
“(iii) Plans described.—A defined benefit plan is described in this clause if—
“(I) the plan provides benefits to a closed class of participants,
“(II) for the plan year as of which the class closes and the 2 succeeding plan years, the plan satisfies the requirements of section 410(b) and subsection (a)(4) (without regard to this subparagraph but taking into account the rules of subparagraph (I)),
“(III) after the date as of which the class was closed, any plan amendment which modifies the closed class or the benefits provided to such closed class does not discriminate significantly in favor of highly compensated employees, and
“(IV) the class was closed before April 5, 2017, or the plan is described in subparagraph (C).
“(C) Plans described.—A plan is described in this subparagraph if, taking into account any predecessor plan—
“(i) such plan has been in effect for at least 5 years as of the date the class is closed, and
“(ii) during the 5-year period preceding the date the class is closed, there has not been a substantial increase in the coverage or value of the benefits, rights, or features described in subparagraph (A) or in the coverage or benefits under the plan described in subparagraph (B)(iii) (whichever is applicable).
“(D) Determination of substantial increase for benefits, rights, and features.—In applying subparagraph (C)(ii) for purposes of subparagraph (A)(iii), a plan shall be treated as having had a substantial increase in coverage or value of the benefits, rights, or features described in subparagraph (A) during the applicable 5-year period only if, during such period—
“(i) the number of participants covered by such benefits, rights, or features on the date such period ends is more than 50 percent greater than the number of such participants on the first day of the plan year in which such period began, or
“(ii) such benefits, rights, and features have been modified by 1 or more plan amendments in such a way that, as of the date the class is closed, the value of such benefits, rights, and features to the closed class as a whole is substantially greater than the value as of the first day of such 5-year period, solely as a result of such amendments.
“(E) Determination of substantial increase for aggregate testing on benefits basis.—In applying subparagraph (C)(ii) for purposes of subparagraph (B)(iii)(IV), a plan shall be treated as having had a substantial increase in coverage or benefits during the applicable 5-year period only if, during such period—
“(i) the number of participants benefitting under the plan on the date such period ends is more than 50 percent greater than the number of such participants on the first day of the plan year in which such period began, or
“(ii) the average benefit provided to such participants on the date such period ends is more than 50 percent greater than the average benefit provided on the first day of the plan year in which such period began.
“(F) Certain employees disregarded.—For purposes of subparagraphs (D) and (E), any increase in coverage or value or in coverage or benefits, whichever is applicable, which is attributable to such coverage and value or coverage and benefits provided to employees—
“(i) who became participants as a result of a merger, acquisition, or similar event which occurred during the 7-year period preceding the date the class is closed, or
“(ii) who became participants by reason of a merger of the plan with another plan which had been in effect for at least 5 years as of the date of the merger,
“(G) Rules relating to average benefit.—For purposes of subparagraph (E)—
“(i) the average benefit provided to participants under the plan will be treated as having remained the same between the 2 dates described in subparagraph (E)(ii) if the benefit formula applicable to such participants has not changed between such dates, and
“(ii) if the benefit formula applicable to 1 or more participants under the plan has changed between such 2 dates, then the average benefit under the plan shall be considered to have increased by more than 50 percent only if—
“(I) the total amount determined under section 430(b)(1)(A)(i) for all participants benefitting under the plan for the plan year in which the 5-year period described in subparagraph (E) ends, exceeds
“(II) the total amount determined under section 430(b)(1)(A)(i) for all such participants for such plan year, by using the benefit formula in effect for each such participant for the first plan year in such 5-year period,
“(H) Treatment as single plan.—For purposes of subparagraphs (E) and (G), a plan described in section 413(c) shall be treated as a single plan rather than as separate plans maintained by each employer in the plan.
“(I) Special rules.—For purposes of subparagraphs (A)(i) and (B)(iii)(II), the following rules shall apply:
“(i) In applying section 410(b)(6)(C), the closing of the class of participants shall not be treated as a significant change in coverage under section 410(b)(6)(C)(i)(II).
“(ii) 2 or more plans shall not fail to be eligible to be aggregated and treated as a single plan solely by reason of having different plan years.
“(iii) Changes in the employee population shall be disregarded to the extent attributable to individuals who become employees or cease to be employees, after the date the class is closed, by reason of a merger, acquisition, divestiture, or similar event.
“(iv) Aggregation and all other testing methodologies otherwise applicable under subsection (a)(4) and section 410(b) may be taken into account.
“(J) Spun-off plans.—For purposes of this paragraph, if a portion of a defined benefit plan described in subparagraph (A) or (B)(iii) is spun off to another employer and the spun-off plan continues to satisfy the requirements of—
“(i) subparagraph (A)(i) or (B)(iii)(II), whichever is applicable, if the original plan was still within the 3-year period described in such subparagraph at the time of the spin off, and
“(ii) subparagraph (A)(ii) or (B)(iii)(III), whichever is applicable,
“(2) Testing of defined contribution plans.—
“(A) Testing on a benefits basis.—A defined contribution plan shall be permitted to be tested on a benefits basis if—
“(i) such defined contribution plan provides make-whole contributions to a closed class of participants whose accruals under a defined benefit plan have been reduced or eliminated,
“(ii) for the plan year of the defined contribution plan as of which the class eligible to receive such make-whole contributions closes and the 2 succeeding plan years, such closed class of participants satisfies the requirements of section 410(b)(2)(A)(i) (determined by applying the rules of paragraph (1)(I)),
“(iii) after the date as of which the class was closed, any plan amendment to the defined contribution plan which modifies the closed class or the allocations, benefits, rights, and features provided to such closed class does not discriminate significantly in favor of highly compensated employees, and
“(iv) the class was closed before April 5, 2017, or the defined benefit plan under clause (i) is described in paragraph (1)(C) (as applied for purposes of paragraph (1)(B)(iii)(IV)).
“(B) Aggregation with plans including matching contributions.—
“(i) In general.—With respect to 1 or more defined contribution plans described in subparagraph (A), for purposes of determining compliance with subsection (a)(4) and section 410(b), the portion of such plans which provides make-whole contributions or other nonelective contributions may be aggregated and tested on a benefits basis with the portion of 1 or more other defined contribution plans which—
“(I) provides matching contributions (as defined in subsection (m)(4)(A)),
“(II) provides annuity contracts described in section 403(b) which are purchased with matching contributions or nonelective contributions, or
“(III) consists of an employee stock ownership plan (within the meaning of section 4975(e)(7)) or a tax credit employee stock ownership plan (within the meaning of section 409(a)).
“(ii) Special rules for matching contributions.—Rules similar to the rules of paragraph (1)(B)(ii) shall apply for purposes of clause (i).
“(C) Special rules for testing defined contribution plan features providing matching contributions to certain older, longer service participants.—In the case of a defined contribution plan which provides benefits, rights, or features to a closed class of participants whose accruals under a defined benefit plan have been reduced or eliminated, the plan shall not fail to satisfy the requirements of subsection (a)(4) solely by reason of the composition of the closed class or the benefits, rights, or features provided to such closed class if the defined contribution plan and defined benefit plan otherwise meet the requirements of subparagraph (A) but for the fact that the make-whole contributions under the defined contribution plan are made in whole or in part through matching contributions.
“(D) Spun-off plans.—For purposes of this paragraph, if a portion of a defined contribution plan described in subparagraph (A) or (C) is spun off to another employer, the treatment under subparagraph (A) or (C) of the spun-off plan shall continue with respect to the other employer if such plan continues to comply with the requirements of clauses (ii) (if the original plan was still within the 3-year period described in such clause at the time of the spin off) and (iii) of subparagraph (A), as determined for purposes of subparagraph (A) or (C), whichever is applicable.
“(3) Definitions and special rule.—For purposes of this subsection—
“(A) Make-whole contributions.—Except as otherwise provided in paragraph (2)(C), the term ‘make-whole contributions’ means nonelective allocations for each employee in the class which are reasonably calculated, in a consistent manner, to replace some or all of the retirement benefits which the employee would have received under the defined benefit plan and any other plan or qualified cash or deferred arrangement under subsection (k)(2) if no change had been made to such defined benefit plan and such other plan or arrangement. For purposes of the preceding sentence, consistency shall not be required with respect to employees who were subject to different benefit formulas under the defined benefit plan.
“(B) References to closed class of participants.—References to a closed class of participants and similar references to a closed class shall include arrangements under which 1 or more classes of participants are closed, except that 1 or more classes of participants closed on different dates shall not be aggregated for purposes of determining the date any such class was closed.
“(C) Highly compensated employee.—The term ‘highly compensated employee’ has the meaning given such term in section 414(q).”