When a member of any such retirement system or pension fund of this state changes his office or employment or is transferred in such manner as to require his withdrawal from any such retirement system or pension fund, and the change or transfer is to an office or position which entitles him to become a member of another retirement system or pension fund, he shall notify the administrative head of the retirement system of which he is a member, prior to or at the time of his withdrawal therefrom, of his intention to enter the other retirement system or pension fund. Upon his entry into the other system or fund he shall be admitted with the credit for prior service to which he was entitled in the system or fund from which he shall have withdrawn and he shall be permitted to deposit in the second retirement system or pension fund the total amount of his contributions so withdrawn from the first retirement system, and the board or administrative head of the first retirement system may transfer to the second retirement system or fund the funds or credit to which the withdrawing member was entitled. He shall, thereupon, as a member of the second retirement system, be entitled to such credit in the way of pension and annuity as is provided by law in the second retirement system or fund, with the prior service credit to which he was originally entitled in the first retirement system.
N.J.S. § 43:2-2