After the writ has been returned, the prisoner may deny any of the facts set forth in the statement and may allege any other material facts; and the court or justice shall examine summarily and without delay the causes of the imprisonment or restraint, hear the evidence produced by any persons interested or authorized to appear and dispose of the prisoner as law and justice require, and may adjourn the examination from time to time.
Mass. Gen. Laws ch. 248, § 15