The defendant in any proceeding for contempt of court in such a case may file with the court a demand for the retirement of the justice sitting in such case, if the contempt arises from an attack upon the character or conduct of such justice and the attack occurred elsewhere than in the presence of the court or so near thereto as to interfere directly with the administration of justice. Upon the filing of any such demand, prior to the hearing in the contempt proceeding, the justice shall thereupon proceed no further, but another justice shall be assigned by the chief justice of the court.
Mass. Gen. Laws ch. 220, § 13B