
214 P.3d 962 (2009)
Joshua HARRIS, Petitioner,
v.
Honorable Edsonya CHARLES, Director of King County Adult Detention and City of Seattle, Respondents.
No. 61629-3-I.
Court of Appeals of Washington, Division 1.
August 31, 2009.
*964 Richard E. Greene, Seattle City Attorney, Seattle, WA, for Appellant.
Christine A. Jackson, The Public Defender, Seattle, WA, for Respondents.
BECKER, J.
¶ 1 A statute entitles felons detained before trial on electronic home monitoring to be credited for the time served. No statute entitles misdemeanants to the same credit. In view of the differences between felony and misdemeanor sentencing, we hold this distinction is rational and does not violate the Equal Protection Clause.

FACTS
¶ 2 Respondent Joshua Harris was charged in Seattle Municipal Court with one count of Driving While License Suspended in the third degree (DWLS Third) and one count of operating a vehicle without an ignition interlock device. He posted bail of $5,000 and began electronic home monitoring on October 22, 2007, as a condition of pretrial release. On January 7, 2008, Harris pleaded guilty to both charges.
¶ 3 On March 7, 2008, the court sentenced Harris to 90 days in jail on the first count, consecutive to a 90-day suspended sentence on the second count. He had served 140 days on electronic home monitoring and asked to be credited for that time. The municipal court denied his request.
¶ 4 Harris was to report to jail on April 9. On March 31, he filed a petition in superior court for a writ of habeas corpus, asking on equal protection grounds that the municipal court be ordered to give him credit for his time on electronic home monitoring, as is required by a statute when sentencing felons. Over the City's objection that felons and misdemeanants are not similarly situated, the superior court granted the writ: "I find that the rule albeit for felonies shall apply here." The municipal court complied with the writ by giving Harris 90 days of credit against his 90-day sentence on the charge of DWLS Third.
¶ 5 The City appeals the superior court's order granting the writ.

HABEAS CORPUSWHAT CONSTITUTES RESTRAINT
¶ 6 The City initially argues that the superior court should not have granted Harris relief in a habeas corpus proceeding because he was not physically restrained when he petitioned for a writ. He had been sentenced, but he had not yet reported to the jail. The City contends that a person may not employ the habeas corpus statute to challenge a sentence he has not yet begun to serve.
¶ 7 RCW 7.36.010 provides: "Every person restrained of his liberty under any pretense whatever, may prosecute a writ of habeas corpus to inquire into the cause of the restraint, and shall be delivered therefrom when illegal." The petition must specify by "whom the petitioner is restrained of his liberty, and the place where." RCW 7.36.030(1). If the petitioner shows that his restraint is illegal, the court must discharge him. RCW 7.36.120.
*965 ¶ 8 In support of the proposition that restraint must be physical, the City relies on an old case, In Re Powell, 191 Wash. 152, 153, 70 P.2d 778 (1937). Modern cases demonstrate that, contrary to the City's argument, being under physical restraint is not a prerequisite for obtaining habeas relief, nor is it necessary that the authority to whom the writ is issued be in a position to physically deliver the petitioner from a place of confinement to the court. Monohan v. Burdman, 84 Wash.2d 922, 925, 530 P.2d 334 (1975); Born v. Thompson, 154 Wash.2d 749, 766, 117 P.3d 1098 (2005). In Born, the court considered older cases holding that a writ should not issue if it will not have an effect on the petitioner's custodial status, but found that such cases "do not state the present function of the writ of habeas corpus." Born, 154 Wash.2d at 766, 117 P.3d 1098. Release from confinement is no longer the sole function of the writ.
¶ 9 A petitioner is under restraint when he is subject to significant adverse consequences. Born, 154 Wash.2d at 763, 117 P.3d 1098. Born challenged a trial court's finding that he was charged with a violent act. As a consequence of the trial court's finding, if Born were to be charged with a misdemeanor in the future and then found to be incompetent, a statute would require that he be committed for competency restoration. The Supreme Court concluded that the potential adverse consequences of the finding were sufficiently significant to conclude that Born was under present restraint. Born, 154 Wash.2d at 764, 117 P.3d 1098. Harris' sentence of 90 days in jail for DWLS Third was a certainty, not a mere possibility. He was sufficiently restrained to seek relief under the habeas statute.

EXPECTATION OF FINALITY
¶ 10 By challenging the superior court's order in this appeal, the City seeks to take away the 90 days of credit Harris received for time served on electronic home monitoring. Harris argues that the City's appeal should be dismissed as moot because re-imposing the 90-day jail term would violate the constitutional prohibition against double jeopardy. An appeal is moot if the court cannot grant relief. State v. Veazie, 123 Wash.App. 392, 397, 98 P.3d 100 (2004); State v. Turner, 98 Wash.2d 731, 733, 658 P.2d 658 (1983).
¶ 11 The double jeopardy clause of the Fifth Amendment to the United States Constitution prohibits a second attempt by the State to increase a sentence if, despite an erroneous sentence, the defendant had a legitimate expectation of its finality. State v. Hardesty, 129 Wash.2d 303, 310-11, 915 P.2d 1080 (1996). A defendant may acquire a legitimate expectation of finality in an erroneous sentence if the sentence has been substantially or fully served, unless the defendant was on notice that the sentence might be modified. Hardesty, 129 Wash.2d at 312, 915 P.2d 1080.
¶ 12 Harris argues that he had a legitimate expectation of finality because, once the municipal court complied with the writ and gave him credit for 90 days on electronic home monitoring, he had completed his sentence. He points out that 90 days is the maximum amount of jail time the court can impose for third degree driving with a suspended license.
¶ 13 While the federal cases cited in Hardesty hold that completion of a sentence ordinarily gives rise to a legitimate expectation of finality, they also indicate that there is no finality until the time for review has expired. See, e.g., United States v. Rico, 902 F.2d 1065, 1068 (2d Cir.1990), cited in Hardesty, 129 Wash.2d at 312, 915 P.2d 1080. "So long as a sentence can be increased on appeal, defendant has no expectation of its finality." Rico, 902 F.2d at 1068.
¶ 14 The City filed a timely appeal. We conclude Harris did not have a legitimate expectation of finality, and re-imposing the original sentence will not violate double jeopardy. The City's appeal is not moot.

EQUAL PROTECTION
¶ 15 The City's main contention on appeal is that Harris was not entitled to the writ of habeas corpus because there was no violation of his constitutional rights. See RCW 7.36.130(1). This court reviews writ *966 actions of the superior court de novo. Butler v. Kato, 137 Wash.App. 515, 521, 154 P.3d 259 (2007).
¶ 16 The equal protection clauses of the state and federal constitutions guarantee that persons situated similarly with respect to the legitimate purpose of the law must receive like treatment. State v. Manussier, 129 Wash.2d 652, 672, 921 P.2d 473 (1996). Equal protection is denied if a valid law is administered in a way that unjustly discriminates between similarly situated persons. State v. Handley, 115 Wash.2d 275, 289, 796 P.2d 1266 (1990). Before a court will scrutinize an equal protection claim, the defendant must establish that he is situated similarly to others in a class. Handley, 115 Wash.2d at 289-90, 796 P.2d 1266.
¶ 17 Harris contends that, as a person who served time on electronic home monitoring before being sentenced, he is in the same class with felons who under the Sentencing Reform Act must be credited for all "confinement" before sentencing if the confinement is served solely in regard to the offense for which the offender is being sentenced. Former RCW 9.94A.505(6) (2009).[1] The Sentencing Reform Act defines "confinement" as including "partial confinement," and "home detention" is defined as a form of "partial confinement." Former RCW 9.94A.030(11), (30), and (35) (2008).[2]
¶ 18 Harris argues that he is situated similarly to felons because no statute prohibits misdemeanants from being credited for time spent on electronic home monitoring. According to Harris, the legislature must afford the same treatment to all defendants who are subjected to electronic home monitoring as a condition of pretrial release.
¶ 19 We apply the "rational basis" test for analyzing an equal protection claim when, as here, a classification does not involve a suspect or semi-suspect class and does not threaten a fundamental right. Manussier, 129 Wash.2d at 673, 921 P.2d 473. Under that test, a law will be upheld if it rests upon a legitimate state objective and is not wholly irrelevant to achieving that objective. Manussier, 129 Wash.2d at 673, 921 P.2d 473. The person challenging the classification must show that it is "purely arbitrary." Omega Nat'l Ins. Co. v. Marquardt, 115 Wash.2d 416, 431, 799 P.2d 235 (1990). According to Harris, there is no rational basis for the legislature to require that credit for time served on electronic home monitoring be given to felons but not misdemeanants.
¶ 20 This argument fails. The sentencing systems for felonies and misdemeanors are significantly different. See Wahleithner v. Thompson, 134 Wash.App. 931, 941, 143 P.3d 321 (2006) (comparing misdemeanor and felony sentences was of limited utility in determining whether misdemeanor sentences constituted cruel and unusual punishment). Pertinent to this case, one significant difference is that felons typically face much higher maximum penalties. State v. Bowen, 51 Wash.App. 42, 46-47, 751 P.2d 1226 (1988). A felon may be sentenced to a life sentence without parole, or even death. RCW 9.94A.510. In contrast, the maximum punishment for a person convicted of a misdemeanor is 90 days in the county jail, a fine of one thousand dollars, or both. RCW 9.92.030; RCW 9A.20.021(3). In general, the maximum punishment for a person convicted of a gross misdemeanor is a year in the county jail, a fine of five thousand dollars, or both. RCW 9.92.020; RCW 9A.20.021(2); RCW 3.50.440.
¶ 21 Typically, a felon who receives credit for time served on electronic home monitoring will still have a significant amount of confinement left to serve. See RCW 9.94A.510 (sentencing grid).[3] The same is *967 much less likely to be true in misdemeanor sentencing. If the court were required to credit the sentence ultimately imposed upon a misdemeanor defendant with time served on electronic home monitoring as a condition of pretrial release, a defendant like Harris who serves more than 90 days could avoid serving any jail time. The potential for this outcome could influence the court's decision whether or not to grant pretrial release to a defendant like Harris who has a history of criminal convictions for driving under the influence. Rather than lose the option of ensuring that jail time is included in the sentence for such a defendant, the court might well decide to hold him in jail pending trial. But if giving credit for time served on electronic home monitoring remains discretionary with the court, the court need not hesitate to use this relatively secure and economical form of pretrial release.[4] Considering the differences between felony and misdemeanor sentencing, it is not arbitrary to limit the court's discretion in one system and leave it unrestricted in the other.
¶ 22 This court reached the same result in Bremerton v. Bradshaw, 121 Wash.App. 410, 88 P.3d 438 (2004). And our decision is not inconsistent with State v. Anderson, 132 Wash.2d 203, 937 P.2d 581 (1997), the case upon which Harris principally relies. In Anderson, the defendant was convicted of a felony and was released on electronic home monitoring pending appeal. On equal protection grounds, he argued that he was entitled to be credited for time served post-trial on electronic home monitoring. In view of the statutory provision that allows such credit to felons for electronic home monitoring served pretrial, the court agreed. Anderson, 132 Wash.2d at 213, 937 P.2d 581. Unlike Anderson, Harris is a misdemeanant. We hold there is a rational basis for treating misdemeanants differently from felons in this context. The misdemeanor courts retain discretion to give credit for time served pretrial on electronic home monitoring, but they are not obliged to do so.
¶ 23 Harris argues that due process, as well as equal protection, entitles him to credit for time served on electronic home monitoring, but that argument fails for the same reason; the decision of the district court was not arbitrary or unfair. See State v. Handley, 115 Wash.2d 275, 290 n. 4, 796 P.2d 1266 (1990).

DOUBLE JEOPARDY
¶ 24 Finally, Harris argues that to deny credit for pretrial electronic home monitoring is a violation of the constitutional prohibition against double jeopardy. The issue here is whether electronic home monitoring is enough like jail to be considered a form of punishment.
¶ 25 The constitutional protection against multiple punishments for the same offense, along with the rights to equal protection and due process, guarantees that an offender will receive credit against his maximum sentence for time served in pretrial detention. Reanier v. Smith, 83 Wash.2d 342, 346, 517 P.2d 949 (1974); In Re Phelan, 97 Wash.2d 590, 594, 647 P.2d 1026 (1982). But credit is not constitutionally mandated for probation time served outside jail. Phelan, 97 Wash.2d at 598, 647 P.2d 1026. No case has held that electronic home monitoring is a form of detention or punishment that triggers the constitutional mandate for credit. On the contrary, this court held that home detention is more analogous to probation time than to jail time and, as a result, the constitution does not require that it be credited against the sentence ultimately imposed. *968 State v. Speaks, 63 Wash.App. 5, 7-8, 816 P.2d 95 (1991), rev'd on other grounds, State v. Speaks, 119 Wash.2d 204, 829 P.2d 1096 (1992). Recognizing that the Sentencing Reform Act expressly makes electronic home monitoring a form of confinement that must be credited, the Supreme Court reversed the Court of Appeals decision in Speaks on statutory grounds. But the Supreme Court acknowledged the likelihood that this court was correct in concluding that such credit is not constitutionally mandated. Speaks, 119 Wash.2d at 207, 829 P.2d 1096.
¶ 26 The double jeopardy clauses protect against multiple punishments for the same offense. State v. McClendon, 131 Wash.2d 853, 862, 935 P.2d 1334 (1997). To determine whether an action is punishment, we look to legislative intent. In re Pers. Restraint of Metcalf, 92 Wash.App. 165, 178, 963 P.2d 911 (1998). If there is no explicit or implicit indication that an action was intended to be punishment, we consider whether its purpose or effect nevertheless is so punitive that it amounts to a criminal penalty. Metcalf, 92 Wash.App. at 178, 963 P.2d 911.
¶ 27 The court rules governing pretrial release, promulgated by the Supreme Court, identify electronic home monitoring as a permissible condition that may be imposed when a court determines that an accused is not likely to appear for trial if released on personal recognizance and there is no less restrictive alternative. CrR3.2(b)(6); CrRLJ 3.2(b)(6). Harris has not provided analysis or evidence showing that electronic home monitoring, when used as contemplated by these rules, was intended to be punishment or that the effect is so punitive that it amounts to a criminal penalty. While electronic home monitoring is not complete freedom, it is certainly free of many of the hardships of staying in jail while awaiting trial.
¶ 28 Harris fails to establish that he was constitutionally entitled to have his 90-day sentence for DWLS Third credited for the time he served on electronic home monitoring. The superior court erred in granting the writ. On remand, the municipal court in its discretion may reimpose the 90-day sentence.
¶ 29 Reversed.
WE CONCUR: DWYER, A.C.J., and AGID, J.
NOTES
[1]  The 2009 amendments to RCW 9.94A.505 did not affect § 6.
[2]  Amendments to RCW 9.94A.030, which became effective August 1, 2009, changed the numbering but not the relevant content of the definitions.
[3]  We recognize there is a small group of felony crimes for which the expected length of sentence is comparable to a misdemeanor sentence. See RCW 9.94A.515 (seriousness level I and II felonies include crimes less threatening to public safety, such as false verification for welfare, unlawful issuance of checks, unlicensed practice of a profession or business, and computer trespass). However, such felonies may rationally be viewed by the legislature as having less impact on public safety than some misdemeanors and, therefore, as not requiring that the sentencing court retain the option of denying credit for pretrial detention time served in partial confinement such as electronic home monitoring.
[4]  The legislature acknowledged the utility of electronic home monitoring in 2005 when it amended RCW 9.94A.737, which relates to community custody violations. See Laws of 2005, ch. 435, § 1 (The legislature believes that electronic monitoring, as an alternative to incarceration, is a proper and cost-effective method of punishment and supervision for many criminal offenders. The legislature further finds that advancements in electronic monitoring technology have made the technology more common and acceptable to criminal justice system personnel, policymakers, and the general public.)
