A plaintiff who brings several actions in the same or in different courts against the same defendant upon causes of action which might have been joined in one action, or who brings separate actions against defendants who might have been joined, shall recover costs in one action only, unless the court, after a hearing, otherwise orders.
Mass. Gen. Laws ch. 261, § 7