(CNN) The governor's races in Virginia and New Jersey usually receive heightened attention because they are the first big statewide races (except for special elections) after a new president takes office. But after all the tumult of Donald Trump's first months as president, this year's focus is even more intense -- for at least one of the contests.

The Virginia governor's race has been captivating, controversial and frequently cutting. Republican nominee Ed Gillespie, a long-time party operative and lobbyist, has dominated the campaign dialogue with a succession of racially tinged attacks on Democrat Ralph Northam, the lieutenant governor. Though Virginia has been trending Democratic, and final pre-election polls still show Northam leading, Gillespie's onslaught has shaken the soft-spoken Democratic nominee and unnerved party activists desperate to record their first big electoral win of the Trump presidency.

By contrast, the New Jersey race has been a relatively sleepy affair that has failed to engage much voter interest: Democrat Phil Murphy, a former investment banker and US ambassador to Germany, has consistently held a double-digit advantage in polls over Republican Lt. Governor Kim Guadagno, who has labored under the unpopularity of both Trump and outgoing GOP Gov. Chris Christie.

Still a big Murphy win, if combined with a Northam victory, would send a chill through other Republicans representing white-collar, cosmopolitan places, especially along the coasts.

Starting on Wednesday morning, both parties will be analyzing the results , but especially Virginia, for lessons they can apply to the 2018 midterm election. Here's a guide to some of the questions each side will be asking.

How big a shadow does Donald Trump cast?

For decades, in an early barometer of voter disappointment in a new president, the party that loses the White House in the previous year has usually won the gubernatorial races in both New Jersey and Virginia.

In Virginia that pattern held in every election from 1977 (when Republican John Dalton prevailed a year after Jimmy Carter's election) through 2009 (when Republican Bob McDonnell triumphed a year after Barack Obama's). Democrat Terry McAuliffe broke the mold in 2013, by narrowly winning the governorship the year after Obama's reelection. In New Jersey the pattern started later, but in every election since 1989, the party out of the White House has captured the governorship.

Exit polls in both states have found a close relationship between attitudes toward the incumbent president and the vote in the governor's race. That's been especially true among those who disapprove of the president. In 2009, about 9 in 10 of the voters who disapproved of Obama voted for McDonnell in Virginia and GOP nominee Chris Christie in New Jersey, powering their victories. In 2013, Christie again won 84% of Obama disapprovers, but Ken Cuccinelli, the polarizing GOP nominee in Virginia, only carried 81% of voters who disapproved of the president. Even though a narrow majority of Virginia voters disapproved of Obama, McAuliffe won because he captured a greater share of the approvers (91% ) than Cuccinelli did of the disapprovers.

Given that surveys have consistently shown Trump's approval rating below 40% in both states, Gillespie and Guadagno must replicate McAuliffe's equation to prevail: they will need to win a higher percentage among Trump approvers than they lose among disapprovers. The challenge is that in both states Trump's disapproval rating among voters is likely to be much higher than Obama's was in 2013, leaving the GOP nominees less room for error.

Gillespie has followed a distinctive strategy of keeping his distance from Trump personally (the President hasn't campaigned in the state) while embracing several of his key themes, for instance on immigration. If that allows Gillespie to suppress his deficit among voters who disapprove of Trump, he may offer a roadmap to other Republicans running in places dubious of the President.

Who votes?

Both states have exemplified the modern Democratic challenge of relying on an electoral coalition that turns out much more in presidential than off-year elections. Against that backdrop, the contests will provide an important early signal on one of the key questions for 2018: whether the Democratic base's intense antipathy toward Trump is enough to reverse that fall-off.

In all key groups, turnout has been lower for these gubernatorial races than it is for the previous year's presidential contest. But the decline usually has been disproportionately greater among the core Democratic groups of young people and minorities, producing an electorate in both states that is whiter and more Republican than in the presidential year. One reason McAuliffe won is because he minimized that fall-off; Northam must match him.

Population growth in Virginia since 2013 has continued to strengthen the groups and places where Democrats are strongest. But Democrats are nervous that Gillespie may inspire a turnout surge among Trump's core constituency of older, blue-collar and non-urban whites with his racially provocative campaign -- which has included a full-throated endorsement of preserving Confederate monuments and unrelenting attacks on "sanctuary cities" and the Central American gang MS-13.

One gauge to watch is how close the minority share of the vote in Virginia comes to reaching about 30% (it hit just under that in 2013 and just over in 2016) -- or whether a combination of depressed turnout among non-whites and elevated turnout among whites significantly reduces that number. Another key benchmark will be whether the affluent Democratic-leaning Northern Virginia suburbs come close to matching the nearly 35% of the statewide vote they cast in 2016-or whether a big rural turnout significantly shrinks that number. Both sides consider it a given that the youth share of the vote will tumble compared to 2016 and the electorate will skew older, which helps Republicans.

Does the class realignment continue?

Another critical dynamic in Virginia will be how much the Trump factor -- and Gillespie's turn toward Trump-like themes -- accelerates the shift in partisan allegiances between blue-collar and white-collar whites, what I've called the class inversion.

As in most states, Republicans now consistently post crushing advantages among Virginia whites without a college degree: Trump in 2016, Gillespie in his narrow 2014 Senate race defeat against Democrat Mark Warner, Cuccinelli in 2013, presidential nominee Mitt Romney in 2012, and McDonnell in 2009, all carried about 70% or more of them. Gillespie needs to equal, if not exceed, that.

But, given the state's substantial minority population, that's not enough for Republicans to win, if Democrats can remain competitive among whites holding at least a four-year college degree, who tend toward more liberal views on cultural and racial issues than their blue-collar counterparts. Obama in 2012, McAuliffe in 2013, Warner in 2014, and Hillary Clinton in 2016, all carried between 42-45% of Virginia's college-educated whites, per exit polls. In each case, that was enough to win.

If Northam matches that range among well-educated whites, he'll likely win too (absent a huge turnout shift toward blue-collar and rural areas). If Northam exceeds that range, it will be a warning shot that Trump's unpopularity with those voters is weighing on other Republicans-an ominous message for the House Republicans who will be defending white-collar districts next year. It would also provide insights on the next question both sides will be asking after Virginia.

Did the immigration issue help or hurt Gillespie?

Northam ran a bland, mostly forgettable campaign, but Gillespie planted a stake by igniting Trump-style cultural confrontations over Confederate monuments and especially "sanctuary cities."

Whether Gillespie wins or loses, analysts in both parties believe other Republicans are likely to reprise his attacks next year because they have clearly shaken Northam. Already, Guadagno has stressed the issue in the campaign's final weeks.

Both sides will be watching whether Gillespie's arguments help him turn out the Trump constituency-and whether, in a backlash, they provoke larger turnout and/or bigger margins than usual for Democrats akmong non-white voters. Gillespie's campaign insists the "sanctuary city" arguments are also helping him with suburban swing voters anxious about crime, while the Northam campaign says the attacks' racial edge have alienated those voters. The answer has big implications for 2018, and both sides will be combing the Virginia results for clues -- particularly the results among college-educated whites and in the DC exurbs-about who's right.

Do the usual guideposts apply?

In each state, political professionals have key yardsticks they will be watching for early clues to the results.

In New Jersey, Michael DuHaime, the chief political strategist for Christie's two gubernatorial victories, points to two signposts. The first is whether Guadagno amasses a bigger combined margin in the GOP's best two large counties, Ocean and Monmouth, than Murphy does in the Democrats' best two, Essex (which includes Newark) and Hudson (which includes Jersey City). The second is whether Guadagno can break through in at least some of the counties that touch the New Jersey turnpike, from Salem and Gloucester in the south to Hudson and Bergen in the North. "When Republicans win, they pick off a few," DuHaime says.

Bergen is worth its own look. The state's largest county, it has evolved from red to blue behind the familiar suburban formula of growing racial diversity and cultural disaffection between the GOP and white-collar whites. A big win for Murphy there would offer another sign of suburban discontent with the Trump-era GOP.

In Virginia, many political experts zero in on two counties. Chesterfield County, just south of Richmond, historically has favored Republicans, but Trump significantly underperformed there. If Gillespie wobbles there too, it will offer an indication of suburban backlash against his embrace of Trump-like themes. Another marker is well-educated Loudon County in the Washington DC exurbs. Gillespie narrowly carried it in 2014, but Clinton trounced Trump there. Gillespie can't afford that.

Given how few voters appear persuadable in this race, turnout in the base counties may be more important than the tilt of the swing counties. "Virginia is not a two-party state: It is two one-party states," says Tom Davis, a former Republican representative from Northern Virginia. "Republicans roll up the margins in the rural areas; Democrats roll up the margins in the cities."

Republicans are looking for big numbers from the mostly smaller places along the Interstate 81 corridor that runs through the state's western edge. Democrats are banking on high Northern Virginia turnout in Alexandria, Arlington and above all Fairfax County, which cast about 300,000 votes in the McAuliffe and Warner victories, but over 550,000 ballots in the 2016 presidential race. "If it starts going more to the proportions you see more in a presidential election...[when] you look at the number of votes they get out of a place like Fairfax County and Arlington it's tough to keep up with that," acknowledges one top GOP strategist.

What happens down the ballot?

Beyond the gubernatorial race, political pros are also watching the Virginia House of Delegates races. That's not because Democrats have a chance of capturing the heavily gerrymandered chamber (Republicans now hold 66 of its 100 seats) but for further indications of whether Trump is hurting the GOP in suburbia. The University of Virginia's Geoffrey Skelley, associate editor of Larry Sabato's Crystal Ball, says the test of a good night for Democrats is whether they net more than the four delegate seats they gained in 2007, their best recent showing. Most of the Democratic opportunities are concentrated in Northern Virginia suburbs and exurbs where Trump has been unpopular and Democrats are energized in opposition to him. These state legislative races will test whether Democratic candidates can convert those dynamics into actual victories on Election Day. And, for 2018, no question looms larger than that.