Washington (CNN) Massachusetts Sen. Ed Markey and challenger Rep. Joe Kennedy III faced off in their first debate of a so-far contentious Democratic primary for one of the Bay State's Senate seats.

The two Democrats sparred on how to best take on Donald Trump as Massachusetts' senator, and campaign finance reform, a sign of how closely the two track ideologically.

"This is not a swing state and this is not a swing seat," Kennedy said in the one-hour televised debate hosted by WGBH News. He added that "absolutely" Markey, the incumbent, has "been a good senator. The issue is that at this moment ... this is not about finding the right bill and voting the right way."

Markey defended his record, and vowed to continue to lead on legislation about the Green New Deal, gun reform and Alzheimer's research. "I have been leading and delivering," Markey said.

At first blush, the Kennedy-Markey matchup is a face off between two opposing generational forces within Democratic politics, but the race is not as clear cut as it may appear.