The defendant, or any interested person, may contest the demand of the plaintiff on or before the return day of the writ by filing an answer in writing, under oath, of his claim or defense, itemizing his account, if any, and the case shall be then at issue between the parties, and shall be tried as other cases in the court. The judgment or judgments of the court shall adjudicate and adjust the rights of the several parties as to the subject matter of the suit, and costs may be adjudged accordingly.