(1) If only a part of the territory within any sanitary and improvement district, any road improvement district, or any fire protection district is annexed by a city or village, the road improvement district or fire protection district acting through its trustees or the sanitary and improvement district acting through its trustees or administrator and the city or village acting through its governing body may agree between themselves as to the division of the assets, liabilities, maintenance, contracts, or other obligations of the district for a change in the boundaries of the district so as to exclude the portion annexed by the city or village or may agree upon a merger of the district with the city or village. The division of assets, liabilities, maintenance, contracts, or other obligations of the district shall be equitable, shall be proportionate to the valuation of the portion of the district annexed and to the valuation of the portion of the district remaining following annexation, and shall, to the greatest extent feasible, reflect the actual impact of the annexation on the ability of the district to perform its duties and responsibilities within its new boundaries following annexation. In the event a merger is agreed upon, the city or village shall have all the rights, privileges, duties, and obligations as provided in sections 31-763 to 31-766 when the city annexes the entire territory within the district, and the trustees or administrator shall be relieved of all further duties and liabilities and their bonds exonerated as provided in section 31-764. No agreement between the district and the city or village shall be effective until submitted to and approved by the district court of the county in which the major portion of the district is located. No agreement shall be approved which may prejudice the rights of any bondholder or creditor of the district or employee under contract to the district. The court may authorize or direct amendments to the agreement before approving the same. If the district and city or village do not agree upon the proper adjustment of all matters growing out of the annexation of a part of the territory located within the district, the district, the annexing city or village, any bondholder or creditor of the district, or any employee under contract to the district may apply to the district court of the county where the major portion of the district is located for an adjustment of all matters growing out of or in any way connected with the annexation of such territory, and after a hearing thereon the court may enter an order or decree fixing the rights, duties, and obligations of the parties. In every case such decree or order shall require a change of the district boundaries so as to exclude from the district that portion of the territory of the district which has been annexed. Such change of boundaries shall become effective on the date of entry of such decree. Only the district and the city or village shall be necessary parties to such an action. Any bondholder or creditor of the district or any employee under contract to the district whose interests may be adversely affected by the annexation may intervene in the action pursuant to section 25-328. The decree when entered shall be binding on the parties the same as though the parties had voluntarily agreed thereto. Nothing contained in this section shall authorize any district to levy any special assessments within the annexed area after the effective date of annexation.
(2) Any contract entered into on or after August 30, 2015, by a sanitary and improvement district for solid waste collection services shall, upon annexation of all or part of such district by a city or village, be canceled and voided as to the annexed areas.