(Reuters) – Stockton and San Bernardino, the two California cities that have filed for bankruptcy protection, are both considered test cases in the epic battle over whether municipal bondholders or pensioners will absorb most of the pain when a government goes broke.

A federal court ruling on Monday that allowed Stockton’s bankruptcy case to move forward underscored the huge differences between the two cases and how they are likely to unfold.

Stockton, the largest U.S. city to seek bankruptcy protection, engaged in years of cost-cutting and attempted to negotiate with its creditors before declaring insolvency – actions that were lauded by U.S. Bankruptcy Judge Christopher Klein on Monday when he ruled the city eligible for bankruptcy protection.

Stockton has kept current on its payments to Calpers, the state pension fund, even as it has defaulted on some bond payments and declared its intention to wring concessions from Wall Street creditors. Thus Calpers has supported Stockton’s bankruptcy filing, while the so-called capital-market creditors have opposed it.

Stockton has also produced a plan for operating in bankruptcy that runs to nearly 800 pages. City Manager Bob Deis, by all accounts, has run the process with an iron fist, and the bankruptcy proceedings are likely to be orderly even as the central conflict between creditors and pensioners is fought bitterly.

In San Bernardino, none of this has happened. The city did not engage in substantial staff nor budget cuts in the years prior to the bankruptcy, nor did it seek to negotiate with any creditors. Instead, the city declared a fiscal emergency, a move aimed at avoiding negotiations, and simply stopped paying both bondholders and Calpers.

Its pre-bankruptcy plan ran to just 12 pages. Its interim city manager, overwhelmed by the process and the city’s corrosive politics, quit earlier this year, as did the finance chief. Affairs in the city are so chaotic that on Monday night the council voted to contract out its finance department.

In court, San Bernardino’s Wall Street creditors – some of them the same as in Stockton’s case – have supported its quest for bankruptcy eligibility, because the city is treating them and Calpers equally. And in another mirror image to Stockton, Calpers is opposing San Bernardino’s request for bankruptcy protection.

“Because San Bernardino did not negotiate with creditors at all before declaring bankruptcy, it has a far heavier burden to prove eligibility for bankruptcy,” said Karol Denniston, a bankruptcy attorney with Schiff Hardin in San Francisco and the author of part of California’s bankruptcy code.

Under both state and federal bankruptcy law, cities must prove that they attempted good faith negotiations with creditors before filing for bankruptcy – or that a sudden fiscal emergency of such scale made negotiations impossible.

Because San Bernardino took the fiscal emergency route, “the city has to show that negotiations were impossible and would not have accomplished anything, and that is much more difficult,” Denniston said.

James Spiotto, a municipal bankruptcy specialist and a partner at Chapman & Cutler in Chicago, said because San Bernardino declared a fiscal emergency, it must now prove that the health, safety and well-being of its residents was in jeopardy if it had not taken such a drastic step.

“That’s a separate, distinct burden of proof, and it’s a difficult and higher one,” Spiotto said.

But, Spiotto added, the chaos suffusing San Bernardino’s affairs “may be the weight of evidence they need to prove they had to declare a financial emergency.”

In Monday’s Stockton ruling, U.S. Bankruptcy Court Judge Christopher Klein suggested that the issue of how pension payments are treated relative to bond payments will be a central one in the case going forward – and the issue will likely be resolved by Klein himself.

In San Bernardino, if the city fails to achieve bankruptcy protection, the same fight between Calpers and Wall Street creditors will take place – but without the orderly supervision of a bankruptcy judge.

Instead, the issue would likely play out in a chaotic flurry of state court cases as city workers, unions, pensioners, bondholders and other creditors press for enforcement of their contractual rights.

ISDA Master Agreement

The ISDA master agreement is the most commonly used master contract for OTC derivative transactions internationally. It is used to govern many of the financial transactions between the City of Detroit and Wall Street. Below are links to the agreement and sites with explanations.