A veteran, as defined in section one of chapter thirty-one, who holds an office or position in the service of the commonwealth not classified under said chapter thirty-one, other than an elective office, an appointive office for a fixed term or an office or position under section seven of this chapter, and has held such office or position for not less than three years, shall not be involuntarily separated from such office or position except subject to and in accordance with the provisions of sections forty-one to forty-five, inclusive, of said chapter thirty-one to the same extent as if said office or position were classified under said chapter. If the separation in the case of such unclassified offices or positions results from lack of work or lack of money, such a veteran shall not be separated from his office or position while similar offices or positions in the same group or grade, as defined in section forty-five of this chapter, exist unless all such offices or positions are held by such veterans, in which case such separation shall occur in the inverse order of their respective original appointments.
Mass. Gen. Laws ch. 30, § 9A