This is a petition brought by the director of social welfare on the authority of G. L. 1956, §§26-4-3 and' 26-4-4. It seeks to have the respondent judicially examined as a condition precedent to the issuance of an order transferring him from the adult correctional institutions to> the ward for the criminal insane. Pursuant to the prayer of the petition, a writ of habeas corpus ad testificandum was *335issued, and the respondent was produced at a hearing before the presiding justice of the superior court. The cause is before us on the respondent’s appeal from the decision of the presiding justice overruling his dilatory pleas and proceeding to a hearing on the merits.
Before considering the instant appeal, we deem it appropriate to review briefly the train of circumstances which led to such appeal.
The respondent, indicted for two murders, was committed without bail to the adult correctional institutions on July 10, 1958 to await trial. On October 21, 1958, on an order issued by the then presiding justice of the superior court, in ex parte proceedings, respondent was ordered transferred to the criminal insane ward of the medical center.
Thereafter, on respondent’s motion, one of the indictments was assigned for trial on March 12, 1962. The state objected to the assignment on the ground that respondent was not mentally competent to stand trial. At a subsequent hearing before a superior court justice, the state’s contention was sustained and the assignment vacated. From that decision, respondent prosecuted a bill of exceptions to this court and the exceptions were overruled. State v. Genereux, 95 R. I. 292, 186 A.2d 738.
The respondent thereupon petitioned for a writ of habeas corpus alleging that his transfer to the ward for the criminal insane on October 21, 1958 was in violation of due process as provided in §§26-4-3 and 26-4-4. We sustained that contention and ordered respondent returned to the adult correctional institutions. Genereux v. Pelosi, 96 R. I. 452, 192 A.2d 630. The respondent was SO' returned and the state brought the instant petition.
It was filed February 3, 1964, a writ of habeas corpus ad testificandum was issued and a hearing on the petition was assigned to February 14, 1964. On that day respondent was not represented by counsel and the presiding justice continued the hearing for two weeks so that the services *336of an attorney could be secured. He stated that if, when the hearing was resumed on February 28, respondent had been unsuccessful in obtaining counsel, the public defender would be requested to assume such representation.
Apparently at the behest of the presiding justice, an assistant public defender conferred with respondent and the latter’s mother on the day the hearing was recessed. The record discloses that at that conference respondent advised the assistant public defender that he was without counsel, but it does not appear that he wished to be represented by the public defender’s office.
On February 26, 1964, respondent was represented by private counsel who entered a special appearance for the purpose of challenging the jurisdiction of the court. He raised this issue by filing two pleas, one in abatement and the other which he entitled, “Plea In Suspension.”
The plea in abatement is in two counts. They are, in substance, first, that respondent had not been given legal notice of the pending proceedings as required by due process and, secondly, that since respondent’s incompetence to stand trial had been established as a legal fact, citing State v. Genereux, supra, he was incompetent to understand the nature of the pending proceedings nor could he assist counsel, and in such circumstances the hearing would be in violation of due process.
His plea in suspension restated in identical language the allegation contained in the second count of the plea in abatement. It concluded, however, that the hearing be suspended until respondent again became legally competent, whereas the plea in abatement prayed that the petition be dismissed.
The petitioner filed a replication to the plea in abatement and moved to dismiss the remaining plea. After hearing the parties on the merits of the pleas, the presiding justice overruled the plea in abatement and considering the other *337as a motion denied it. From these rulings respondent claimed an appeal to this court.
The record further discloses that after the presiding justice had given his decision on the pleadings, counsel for respondent was permitted to withdraw. Thereupon, the assistant public defender wlm had conferred with respondent on February 14 assumed representation for him at the presiding justice’s request.
The petitioner offered the testimony of two qualified psychiatrists attached to. the institute of mental health of the state of Rhode Island medical center. They testified that respondent was mentally ill and, in effect, that he required the custodial care and treatment provided in the ward for the criminal insane.
The respondent and his mother both testified and opposed the issuance of an order which would recommit respondent as -prayed. He stated that he believed he was improving, attributing it to association with the sane inmates at the adult correctional institutions. He further testified that he was depressed by the surroundings in the ward for the criminal insane. His mother testified that she had visited her son regularly at both places of confinement. It was her opinion that he benefited from the association with sane prisoners and the routine of the adult, correctional institutions.
The presiding justice reviewed the evidence before him and concluded that the best interests of respondent would be served by confining him in the ward for the criminal insane, granted the petition and issued the requisite order.
The respondent has assigned- three reasons of appeal, namely, that the presiding justice erred in overruling the plea in abatement, in denying the plea in suspension, and in proceeding -to- a hearing on the merits without giving him ■an opportunity to plead over, engage counsel or prepare his defense.
*338Because the second count of the plea in abatement and plea or motion to suspend contain identical assertions, we shall consider such contention as is made with respect thereto as though there were but one plea. It is contended that since at the time of the hearing respondent was mentally incompetent to stand trial, having been so determined in a prior judicial proceeding, he was not competent to be subjected to a hearing on the instant petition. This contention is self-defeating. During argument in this court, respondent conceded that if this proposition were accepted as sound, the question of proceeding on a hearing only after respondent regained competence would become moot by necessity. In such circumstances the legislature would, with like necessity, be held to have enacted a meaningless provision for a judicial hearing. This is so obviously lacking in logic as to be rejected out of hand. Clearly, when enacting chap. 4 of title 26, t'he legislature was cognizant of the circumstances which would prevail whenever the occasion arose for applying its provisions.
The respondent’s contention that the court was without jurisdiction as set forth in the first count of his plea in abatement is, however, not completely lacking in merit. He argues that he was entitled to notice and that the writ of habeas corpus ad testificandum was directed to his custodian and this cannot be held to have been notice to him. He also argues that knowledge without legal notice is insufficient, citing Richard v. Industrial Trust Co., 85 R. I. 292.
We agree that the statute in question contemplates that the inmate will be informed of the filing of the petition and of the proposed hearing sufficiently prior in time to the date of the hearing as to afford an opportunity to take whatever steps may seem advisable in connection therewith. We do not agree, however, that such information must amount to legal notice. Rather it is sufficient if such inmate is afforded an opportunity to testify, to' adduce evidence, and to be represented by counsel if desired.
*339In the instant cause respondent was informed of the pendency of the petition at least two weeks prior to the actual hearing. On February 14, respondent was taken to the courthouse and may not have known of the contemplated transfer prior to' that date. However, the presiding justice refused to proceed until respondent had been given a reasonable opportunity to engage counsel and took steps to provide him with counsel if necessary.
The respondent argues, however, that the representation thus provided necessarily fell short of the compliance contemplated by due process. He cites numerous cases1 from federal and state jurisdictions but none of them is in point. In each case the proceeding was a trial on the indictment or information charging a crime and we are in complete accord with the principles laid down in the cases cited.
Here, however, the only question to be determined was the advisability of transferring respondent from lawful custody in the adult correctional institutions to custodial care and treatment in the ward for the criminal insane. The statute provides that an order for such transfer may be made whenever the presiding justice of the superior court is satisfied that the transfer is in the best interests of the inmate, making his decision only after such examination as he may deem proper. In our judgment, therefore, the trial justice did not err in his rulings on respondent's pleas nor in proceeding to a hearing on the petition immediately thereafter.
In reaching this conclusion we are not unmindful that prior to the instant hearing respondent had been judicially determined to be legally incompetent, a circumstance which may not ordinarily prevail when, in the judgment of the proper authorities, the transfer of a prison inmate to< the ward for the criminal insane is deemed advisable. We have reached our decision, however, without regard to this circumstance so that it may not be considered as wholly or partially persuasive. .
William I. Matzner, for petitioner. Pontarelli & Berberian, Aram K. Berberian, for respondent.The respondent’s appeal is denied and dismissed, and the cause is remanded to the superior court for further proceedings.