Democrats, for the most part, feel good about the way the primary campaign has unfolded, with about seven in 10 Pennsylvania voters saying on Tuesday that the campaign has energized rather than divided their party, according to exit polls. In Connecticut, about two-thirds of Democratic primary voters said so.

The opposite is true of the Republican race, where a majority of Pennsylvania voters said on Tuesday that the campaign had done more to pull the party apart. In New York last week, about six in 10 Republican primary voters said the campaign had divided the party.

But Republicans have shown that they may not be especially worried about preserving the health of their party as it stands today. In most states with exit polling this year, a majority of Republican voters have said they are hoping to elect a president who is a political outsider. Donald J. Trump is that candidate — and he tends to win decisively among anti-establishment voters.