It's long been settled that every city and town in New Jersey has to zone for its "fair share" of affordable housing.

But that axiom is now facing a major test in the state Supreme Court, where oral arguments on Wednesday pitted housing activists hoping for more affordable units against municipalities trying to lessen their burden.

The dispute rests on the period from 1999 to 2015, when the state agency tasked with divvying up those "fair share" allotments was not functioning.

While some municipalities continued to zone for and build affordable housing during the 16-year "gap period," others did not. And housing advocates want those municipalities that did not to be responsible in the future for the burdens they shirked in the past.

"These people are real. Their needs are real. The Legislature intended their needs to be met," said Kevin Walsh, executive director of the nonprofit Fair Share Housing Center. The Legislature "couldn't possibly have imagined something that would lead to a 16-year hiatus."

During the gap, the Council on Affordable Housing, known as COAH, was tasked with assigning municipalities their "fair share" requirements but was unable to issue those numbers.

But Jeff Surenian, an attorney who represents nearly 50 municipalities, said it was not fair to force municipalities to retroactively zone for affordable housing that it did not know it was responsible for.

"Municipalities weren't at fault," said Surenian. "We didn't have standards, and it's not fair to fault municipalities."

Gov. Chris Christie, a Republican, dissolved COAH in 2011. The responsibility of assigning affordable housing allocations to municipalities has since fallen to the county Superior Courts.

The constitutional requirement that every municipality in New Jersey zone for its "fair share" of affordable housing arose from the Mount Laurel decision in 1983.

In February, a Superior Court judge ruled that municipalities in Ocean County had to zone for housing needs that arose during the 16-year gap in addition to current present and future needs.

But a three-judge Appellate Division panel largely reversed that ruling in July, claiming that municipalities were not responsible for affordable housing needs that arose during the gap period.

More than 80 towns have agreed to settlements around their affordable housing obligations amounting to more than 30,000 units of housing, according to a Fair Share Housing Center spokesman.