NYC is the center of the universe. And it may seem, the main driver of state politics and policies.

But there is something going on way out on Long Island, in Suffolk County, that’s important to New York City, too. It involves the odious practice of cross-endorsements, backroom deal-making among party leaders, and the political swamp against which voters rightly have been rebelling. And it could decide who controls the State Senate, the only GOP stronghold in state government, a thorn in the side of Mayor Bill de Blasio and the place where issues important to those in NYC go to die.

The case study is the sordid, convoluted race for county sheriff in Suffolk. Yes, it’s an elected post.

Lawrence Zacarese, a former NYPD officer now with Stony Brook University’s police department, upset the Republican designee, State Sen. Phil Boyle, in Tuesday’s primary. Boyle, a registered Republican, has no law enforcement experience but got the GOP nomination in cahoots with the Conservative Party and its former chairman Ed Walsh, who wanted revenge on the current sheriff. That’s because the sheriff provided the evidence that got Walsh, a former corrections lieutenant, convicted by the feds on corruption charges.

Democratic support for a Republican?

At the same time, Suffolk Democratic boss Rich Schaffer made his own deal with Conservatives to get their backing for judgeships; having that second line on the fall ballot means something in the suburbs. Part of that deal seems to include giving the Democratic line for sheriff to Boyle, which would have guaranteed his victory in November by having several lines on the ballot. Now that Boyle lost the key GOP line, his only chance of winning appears to be getting the Democratic slot.

So, a Republican loses a primary in Suffolk County — which went for Donald Trump in the presidential election — and the Democratic boss makes it all better by giving him that party’s line. Democratic activists and progressives on Long Island who have long believed Schaffer keeps Republicans in power in Albany are outraged.

There’s a lot at stake — noxious cross endorsements, party leader hypocrisy and the perversion of the political process. It’s everything people hate about politics, and it breeds a cynicism that disillusions voters and keeps good people from running for office. It’s the embodiment of the swamp that empowered Trump among those who are fed up with the political system.

What Gov. Cuomo could do

It’s also a litmus test for the state Democratic Party. Gov. Andrew M. Cuomo says he opposes cross-endorsements; as the party’s real head, asking Schaffer to stand down on Boyle would be a powerful sign that Cuomo walks that talk. Democrats around the state and country also want Cuomo, who has preferred a Republican-controlled Senate during budget negotiations, to act like a “true” Democrat and work harder to get the Senate under the party’s control and prove his progressive bona fides in advance of a possible 2020 presidential run.

Keep your eyes on Long Island. The fight for decency in Suffolk’s politics is about to roil NYC and state as well.