WASHINGTON — Major cases await the justices of the U.S. Supreme Court when they return to the bench in January, including a test of how states purge their databases of unqualified voters and a challenge likely to deal a serious blow to the nation's public sector unions.

In both cases, the Trump administration has switched sides, reversing the positions taken by the Justice Department under President Barack Obama and Attorney General Eric Holder.

As the court works toward finishing its term in late June, it will issue highly anticipated rulings on whether businesses can refuse to provide services to gay customers and whether the government can get cellphone records without a search warrant to track a person's movements.

The justices will also rule on whether states can become so blatantly partisan in drawing the boundary lines for voting districts that they violate the Constitution — a decision that could affect the future of American politics.

The voter purging case involves a challenge to Ohio's system for keeping its registration lists up to date. Civil rights groups argue that it discourages minority turnout, but the state says it's an important tool in maintaining the accuracy of its data.

A voter fills out a ballot on the first day of early voting at the Hamilton County Board of Elections on Oct. 11, 2017, in Cincinnati, Ohio. John Minchillo / AP

The issue is what a state can assume from a resident's failure to cast a vote in more than one election. Ohio sends notices to those who fail to cast a ballot during a two-year period, assuming they've moved. Those who do not respond and don't vote over the next four years are dropped from the list of registered voters.

"All states need to do periodic maintenance, but there's the risk that eligible voters will be inadvertently removed. So the details really matter," said Prof. Rick Hasen, an expert on election law at the University California at Irvine.

A handful of other states use a similar system, but more are likely to follow if Ohio wins, he says.

A federal appeals court ruled that Ohio's system violated a federal law, the National Voter Registration Act, which says voters can be purged from the rolls only if they ask, move, are convicted of a felony, become mentally incapacitated or die. A failure to vote, the court said, should not trigger the beginning of the purging process.

The Justice Department supported the challengers in the lower courts. But after the Supreme Court agreed to hear the case and with "the change in Administrations, the Department reconsidered the question," the Trump administration said in its court filing. It now supports Ohio.

In a case that could do serious damage to the health of unions representing millions of the nation's public employees, the justices will decide whether state government workers who choose not to join a union must still pay a share of union dues to cover the cost of negotiating contracts. At stake is the future power and financial health of public sector unions in the 22 states where they have a duty to bargain for both members and nonmembers alike.

Anti-union groups argue that requiring nonunion members to pay a portion of union dues forces them to endorse views they don't agree with, violating their First Amendment rights. But the unions say it's expensive to negotiate contracts that provide benefits to nonunion members as well. They argue that the fees prevent "free riders."

Two years ago, the Supreme Court took up the identical question in a case involving California teachers. But after it was argued, Justice Antonin Scalia's death left the court with eight justices, and the case ended in a 4-4 tie, which resulted in no decision.

This time, the addition of the newest justice, Neil Gorsuch, a steadfast conservative, makes it very likely that the court will side with the challengers and rule against the unions.

In another dramatic reversal, the Trump administration is no longer supporting the unions, as the Obama administration did. The government's earlier position "gave insufficient weight to the First Amendment interest of public employees in declining to fund speech on contested matters of public policy," said Solicitor General Noel Francisco.

As the term nears an end, attention will again be focused on possible retirements. Last year, friends of Anthony Kennedy said he was considering stepping down, but he has given no public hint of his plans. He turns 82 in July.

Ruth Bader Ginsburg, who will be 85 in March, has given no indication that she is thinking of leaving the bench, and friends say she remains healthy. This year saw the publication of "The RBG Workout: How She Stays Strong ... and You Can Too!" by her personal trainer, Bryant Johnson.