The idea that public employee contracts, no matter how generous or how much of a financial anchor they represent for communities, cannot be changed is about to be put to the test on a couple of fronts.

One is in Detroit, which on Thursday became the largest city in the nation to ever file for bankruptcy protection.

It's no mystery why. The city, which has seen its population plummet from about 2 million to 700,000 over the past half-century, is now $19 billion in debt. Roughly half of that — $9.2 billion — represents unfunded liabilities for pension and health care benefits for retired city employees.

The Motor City is in such a bad way that it may sell its airport or part or all of the collections from the Detroit Institute of Arts to help ease its financial burden.

The city is also looking into converting current public employees from a defined-benefit system to a 401(k)-type defined-contribution plan, a move that some cities in California have attempted with limited success. Detroit is also planning to go one step further in cutting benefits for current retirees, many of whom are on fixed incomes. It's a regrettable move. But if it's the product of years of willful neglect in confronting unsustainable benefit handouts and it's what's required to stave off insolvency, the city may have no choice.

Public employee unions and retirees are gearing up for a legal fight. They argue that the labor contracts can't be changed for existing employees let alone for retirees. They point to Michigan state laws, which are much like California's, as justification for their position.

Such debates are not new. They've taken place in a number of communities, including Vallejo, San Bernardino and Stockton, which have also filed for bankruptcy. But the case to watch is in a city that so far has not sought protection from its creditors — San Jose.

On Monday, court arguments began in a legal battle over the legitimacy of a pension reform measure that San Jose voters approved more than a year ago.

Measure B, which 70 percent of voters approved in June 2012, requires city employees to pay up to 16 percent of their salaries to retain existing retirement plans or accept scaled-down benefits. It also requires that new public employees get benefits that are less generous than existing employees.

The ballot measure, heavily supported by Mayor Chuck Reed, came about after the city made deep cuts in services, including scaling back operating hours for libraries and the community center. But the city still found itself with a $2.9 billion shortfall in meeting its obligations to retirees.

Public employees unions are challenging the ballot measure, saying it violates a "vested rights" guarantee in California that holds that public agencies cannot unilaterally cut employees pension benefits — either what has been accrued or what will be accrued — under any conditions, no matter how grim a community's financial picture.

Employees should continue to be protected from losing benefits they've already accrued through public service. But the idea that cities can be prevented from reducing what employees accrue going forward — particularly in light of the negligence that's been exposed in the awarding of unsustainably generous benefits in California — defies common sense. It also should defy state law.

Here's hoping San Jose shows the way out of this pension mess.